Fix for reboot attempt and catch internal failures.
The assumption was reboot attempt left will be sent through
reading data in ipmi sensor data, but it is being sent as
assertion so adding support to read raw data from assertion bits.
Added a catch for internal failures while calling update function
for sensors.
Change-Id: If45d003c1c22f60e7c8a723c1ff9d077c53cad37
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
diff --git a/sensordatahandler.cpp b/sensordatahandler.cpp
index 6c7b9ac..7c4cd3c 100644
--- a/sensordatahandler.cpp
+++ b/sensordatahandler.cpp
@@ -40,9 +40,9 @@
auto mapperResponseMsg = bus.call(mapperCall);
if (mapperResponseMsg.is_method_error())
{
- std::string err = "Error in mapper GetSubTree "
- "Interface: " + interface;
- log<level::ERR>(err.c_str());
+ log<level::ERR>("Mapper GetSubTree failed",
+ entry("PATH=%s", path),
+ entry("INTERFACE=%s", interface));
elog<InternalFailure>();
}
@@ -50,10 +50,9 @@
mapperResponseMsg.read(mapperResponse);
if (mapperResponse.empty())
{
- std::string err = "Invalid response from mapper "
- "Command: GetSubTree "
- "Interface:" + interface;
- log<level::ERR>(err.c_str());
+ log<level::ERR>("Invalid mapper response",
+ entry("PATH=%s", path),
+ entry("INTERFACE=%s", interface));
elog<InternalFailure>();
}
@@ -66,10 +65,9 @@
const auto& iter = mapperResponse.find(path);
if (iter == mapperResponse.end())
{
- std::string err = "Error in finding sensor dbus"
- "Command: GetSubTree "
- "Interface:" + interface;
- log<level::ERR>(err.c_str());
+ log<level::ERR>("Coudn't find d-bus path",
+ entry("PATH=%s", path),
+ entry("INTERFACE=%s", interface));
elog<InternalFailure>();
}
return std::make_pair(iter->first, iter->second.begin()->first);