manager: Lower software version log severity
During the transition to using phosphor-settings-defaults-native for
setting the software version, the version field may temporarily be
empty. This change lowers the log severity for that case to avoid
unnecessary warnings during expected intermediate states.
'''
Jun 20 02:41:49 bmc bmcwebd[709]: [error_messages.cpp:1248] Internal Error /usr/src/debug/bmcweb/1.0+git/redfish-core/include/utils/sw_utils.hpp(126:32) `void redfish::sw_util::afterGetProperties(const std::shared_ptr<bmcweb::AsyncResp>&, const std::string&, bool, const std::string&, const std::string&, bool, const boost::system::error_code&, const dbus::utility::DBusPropertiesMap&)`:
'''
Change-Id: I9123278f863fcf04107b42a5996ccb725c1bd870
Signed-off-by: Daniel Hsu <Daniel-Hsu@quantatw.com>
diff --git a/redfish-core/include/utils/sw_utils.hpp b/redfish-core/include/utils/sw_utils.hpp
index 8f0cba8..ed1ffc2 100644
--- a/redfish-core/include/utils/sw_utils.hpp
+++ b/redfish-core/include/utils/sw_utils.hpp
@@ -119,7 +119,7 @@
return;
}
- if (version == nullptr || version->empty())
+ if (version == nullptr)
{
messages::internalError(asyncResp->res);
return;
@@ -160,6 +160,11 @@
}
if (!activeVersionPropName.empty() && runningImage)
{
+ if (version->empty())
+ {
+ BMCWEB_LOG_INFO("Version is empty for swId: {}", swId);
+ return;
+ }
asyncResp->res.jsonValue[activeVersionPropName] = *version;
}
}