diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-07-30 19:38:20 -0400 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-08-03 01:52:48 +0000 |
commit | edaeb31c886e2b8d2d43664ec4178c8d35094742 (patch) | |
tree | 7a3a162ef3bae35ee1944dbe3a78e673b20f83c5 /monitor/fan.cpp | |
parent | d7999b7c8d052dd64628b615a6ff84f189fd40ef (diff) | |
download | phosphor-fan-presence-edaeb31c886e2b8d2d43664ec4178c8d35094742.tar.gz phosphor-fan-presence-edaeb31c886e2b8d2d43664ec4178c8d35094742.zip |
monitor: Allow missing sensors
Don't count sensors that don't exist as nonfunctional. Let some
other application decide if missing sensors are a problem or not.
Change-Id: Ie3d438c92df16bfd86ddc86db8a9dd143bf2cfb0
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'monitor/fan.cpp')
-rw-r--r-- | monitor/fan.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/monitor/fan.cpp b/monitor/fan.cpp index f3937c2..6d88d2a 100644 --- a/monitor/fan.cpp +++ b/monitor/fan.cpp @@ -49,13 +49,21 @@ Fan::Fan(sdbusplus::bus::bus& bus, for (auto& s : sensors) { - _sensors.emplace_back( - std::make_unique<TachSensor>(bus, - *this, - std::get<sensorNameField>(s), - std::get<hasTargetField>(s), - std::get<timeoutField>(def), - events)); + try + { + _sensors.emplace_back( + std::make_unique<TachSensor>( + bus, + *this, + std::get<sensorNameField>(s), + std::get<hasTargetField>(s), + std::get<timeoutField>(def), + events)); + } + catch (InvalidSensorError& e) + { + + } } //Start from a known state of functional |