regulators: Enhance config file parser
Enhance JSON config file parser to convert relative inventory paths to
absolute form.
Tested:
Run local CI with -Dlong-tests=enabled to enable tests for
validate-regulators-config.py.
Signed-off-by: Bob King <Bob_King@wistron.com>
Change-Id: I80237a673f9c5918898db15363847722141388e6
diff --git a/phosphor-regulators/src/error_logging.cpp b/phosphor-regulators/src/error_logging.cpp
index 309d9b6..bf3467c 100644
--- a/phosphor-regulators/src/error_logging.cpp
+++ b/phosphor-regulators/src/error_logging.cpp
@@ -78,11 +78,8 @@
void DBusErrorLogging::logPMBusError(Entry::Level severity, Journal& journal,
const std::string& inventoryPath)
{
- // Convert relative inventory path to an absolute path
- std::string absInventoryPath = getAbsoluteInventoryPath(inventoryPath);
-
std::map<std::string, std::string> additionalData{};
- additionalData.emplace("CALLOUT_INVENTORY_PATH", absInventoryPath);
+ additionalData.emplace("CALLOUT_INVENTORY_PATH", inventoryPath);
logError("xyz.openbmc_project.Power.Error.PMBus", severity, additionalData,
journal);
}
@@ -90,11 +87,8 @@
void DBusErrorLogging::logWriteVerificationError(
Entry::Level severity, Journal& journal, const std::string& inventoryPath)
{
- // Convert relative inventory path to an absolute path
- std::string absInventoryPath = getAbsoluteInventoryPath(inventoryPath);
-
std::map<std::string, std::string> additionalData{};
- additionalData.emplace("CALLOUT_INVENTORY_PATH", absInventoryPath);
+ additionalData.emplace("CALLOUT_INVENTORY_PATH", inventoryPath);
logError("xyz.openbmc_project.Power.Regulators.Error.WriteVerification",
severity, additionalData, journal);
}