PEL: Update getInventoryFromLocCode

Add an argument to this function that says if the location code passed
in is already expanded (has the fcs and mts placeholders filled in with
VPD data).

This will be used in an upcoming commit that pulls location codes out of
PEL callouts.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Icefa9475962bdf161ddb8b51ce3dab805bcd396b
diff --git a/extensions/openpower-pels/data_interface.cpp b/extensions/openpower-pels/data_interface.cpp
index 1477806..c57593d 100644
--- a/extensions/openpower-pels/data_interface.cpp
+++ b/extensions/openpower-pels/data_interface.cpp
@@ -370,15 +370,25 @@
     return expandedLocationCode;
 }
 
-std::string DataInterface::getInventoryFromLocCode(
-    const std::string& unexpandedLocationCode, uint16_t node) const
+std::string
+    DataInterface::getInventoryFromLocCode(const std::string& locationCode,
+                                           uint16_t node, bool expanded) const
 {
-    auto method = _bus.new_method_call(
-        service_name::vpdManager, object_path::vpdManager,
-        interface::vpdManager, "GetFRUsByUnexpandedLocationCode");
+    std::string methodName = expanded ? "GetFRUsByExpandedLocationCode"
+                                      : "GetFRUsByUnexpandedLocationCode";
 
-    method.append(addLocationCodePrefix(unexpandedLocationCode),
-                  static_cast<uint16_t>(0));
+    auto method =
+        _bus.new_method_call(service_name::vpdManager, object_path::vpdManager,
+                             interface::vpdManager, methodName.c_str());
+
+    if (expanded)
+    {
+        method.append(locationCode);
+    }
+    else
+    {
+        method.append(addLocationCodePrefix(locationCode), node);
+    }
 
     auto reply = _bus.call(method);