change error trace to info in unit state check
The getUnitState() function was made more generic recently to handle
looking at other units. In some cases, a unit like the
obmc-bmc-service-quiesce@.target will not be loaded so systemd will not
be able to return any information to the GetUnit call.
This should not be treated like an error so change the log to an info
one. Callers of the function properly handle the empty string return.
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: Iadbb95acc1bce2b383f1339c9bf641c12c93787b
diff --git a/bmc_state_manager.cpp b/bmc_state_manager.cpp
index 2b78520..ba8ee16 100644
--- a/bmc_state_manager.cpp
+++ b/bmc_state_manager.cpp
@@ -61,7 +61,9 @@
}
catch (const sdbusplus::exception::exception& e)
{
- error("Error in GetUnit call: {ERROR}", "ERROR", e);
+ // Not all input units will have been loaded yet so just return an
+ // empty string if an exception is caught in this path
+ info("Unit {UNIT} not found: {ERROR}", "UNIT", unitToCheck, "ERROR", e);
return std::string{};
}
@@ -76,7 +78,7 @@
{
auto result = this->bus.call(method);
- // Is obmc-standby.target active or inactive?
+ // Is input target active or inactive?
result.read(currentState);
}
catch (const sdbusplus::exception::exception& e)