PEL: Dynamic location code for registry callout

The PEL callout type 'symbolic FRU with trusted location code'
previously had both the symoblic FRU name and the location code
specified in the PEL message registry.  However, there are cases where
the location code is not known until runtime so it cannot be specified
in the registry.

To solve this, create a boolean 'UseInventoryLocCode` key that can be
used in the registry callout entry to specify that the location code to
use for the callout should come from the FRU passed in using the
CALLOUT_INVENTORY_PATH entry in the AdditionalData event log property.
In this case, that FRU will not be added as a normal FRU callout as it
would normally be otherwise.  The registry that uses this must be the
first one in the callout list.

For example:
{
    "Priority": "high",
    "SymbolicFRUTrusted": "air_mover",
    "UseInventoryLocCode": true
},

along with CALLOUT_INVENTORY_PATH=<processor 0 path>

would result in a symbolic FRU callout with the trusted location code
being the processor 0 location code.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Iaf65c523803662313f2ad5e197262b9f4e722332
diff --git a/extensions/openpower-pels/registry.cpp b/extensions/openpower-pels/registry.cpp
index 22cdc27..c8f10d7 100644
--- a/extensions/openpower-pels/registry.cpp
+++ b/extensions/openpower-pels/registry.cpp
@@ -406,6 +406,7 @@
     RegistryCallout callout;
 
     callout.priority = "high";
+    callout.useInventoryLocCode = false;
 
     if (json.contains("Priority"))
     {
@@ -431,6 +432,11 @@
             json["SymbolicFRUTrusted"].get<std::string>();
     }
 
+    if (json.contains("UseInventoryLocCode"))
+    {
+        callout.useInventoryLocCode = json["UseInventoryLocCode"].get<bool>();
+    }
+
     return callout;
 }