hardware: push alarm-inventory alarms in one batch
This reduces the first initial push to alarm-inventory from 4 edits to
1.
What a simple diff in src/ and what a mess under tests/.
Change-Id: I07f38e529341f2bcdcc51e2e9562b641971c553e
diff --git a/src/ietf-hardware/sysrepo/Sysrepo.cpp b/src/ietf-hardware/sysrepo/Sysrepo.cpp
index 02e6720..7381b70 100644
--- a/src/ietf-hardware/sysrepo/Sysrepo.cpp
+++ b/src/ietf-hardware/sysrepo/Sysrepo.cpp
@@ -95,10 +95,14 @@
std::map<std::string, State> thresholdsStates;
std::set<std::pair<std::string, std::string>> activeSideLoadedAlarms;
- alarms::pushInventory(m_session, ALARM_THRESHOLD_CROSSING_LOW, "Sensor value is below the low threshold.", {});
- alarms::pushInventory(m_session, ALARM_THRESHOLD_CROSSING_HIGH, "Sensor value is above the high threshold.", {});
- alarms::pushInventory(m_session, ALARM_SENSOR_MISSING, "Sensor is missing.", {});
- alarms::pushInventory(m_session, ALARM_SENSOR_NONOPERATIONAL, "Sensor is flagged as nonoperational.", {});
+ alarms::pushInventory(
+ m_session,
+ {
+ {ALARM_THRESHOLD_CROSSING_LOW, "Sensor value is below the low threshold."},
+ {ALARM_THRESHOLD_CROSSING_HIGH, "Sensor value is above the high threshold."},
+ {ALARM_SENSOR_MISSING, "Sensor is missing."},
+ {ALARM_SENSOR_NONOPERATIONAL, "Sensor is flagged as nonoperational."},
+ });
while (!m_quit) {
m_log->trace("IetfHardware poll");