Fix compile error
Fixes a name duplication of variable.
Tested: Compiles clean.
Signed-off-by: Santosh Puranik <santosh.puranik@in.ibm.com>
Change-Id: I5773e768ccf96b5d7893820fdf34d05889d95ce3
diff --git a/ibm_vpd_app.cpp b/ibm_vpd_app.cpp
index 1c212f8..1914b2f 100644
--- a/ibm_vpd_app.cpp
+++ b/ibm_vpd_app.cpp
@@ -809,14 +809,14 @@
if (isSystemVpd)
{
- string systemJson{};
+ string systemJsonName{};
if constexpr (is_same<T, Parsed>::value)
{
// pick the right system json
- systemJson = getSystemsJson(vpdMap);
+ systemJsonName = getSystemsJson(vpdMap);
}
- fs::path target = systemJson;
+ fs::path target = systemJsonName;
fs::path link = INVENTORY_JSON_SYM_LINK;
// Create the directory for hosting the symlink
@@ -859,6 +859,15 @@
try
{
auto systemJson = json::parse(sysJson);
+ if (systemJson["system"].find(imKeyword) !=
+ systemJson["system"].end())
+ {
+ if (systemJson["system"][imKeyword].find("constraint") !=
+ systemJson["system"][imKeyword].end())
+ {
+ systemType += "_" + hwKeyword;
+ }
+ }
}
catch (json::parse_error& ex)
{
@@ -866,16 +875,6 @@
SYSTEM_JSON)));
}
- if (systemJson["system"].find(imKeyword) !=
- systemJson["system"].end())
- {
- if (systemJson["system"][imKeyword].find("constraint") !=
- systemJson["system"][imKeyword].end())
- {
- systemType += "_" + hwKeyword;
- }
- }
-
setDevTreeEnv(systemType);
}
}