PEL: allow optional description in "Error Details"

In message_registry.json under "SRC" and "Words6To9", you must define
"AdditionalDataPropSource" for each hex word so that peltool will know
which additional user data field maps to hex words 6 through 9. You can
also define a "Description" field for each hex word, which will be
displayed in the "Error Details" section of the PEL. Currently, if
"AdditionalDataPropSource" is defined, then "Description" must be
defined as well. Otherwise, peltool will throw an error and none of the
PEL will be parsed, not even the user data sections.

The "Description" fields in the message registry are static and can
only have one definition per "ReasonCode". However, some components
need more dynamic descriptions of the hex words, which can be done with
python modules specifically created for SRC parsing. This parser output
will be displayed in the "SRC Details" section of the PEL. When the
parser is defined, there is no need to display any any additional
descriptions in the "Error Details" section. Unfortunately, if the
"Description" field is omitted then the "AdditionalDataPropSource" field
in the message registry would have to be omitted as well. The consequence
of this is that peltool would not know how to map the additional data
fields to hex words 6 through 9, which leave them as zero and breaks the
SRC parser because there no long is any data to parse.

This commit allows the "AdditionalDataPropSource" fields can be defined
without the "Description" field so that the data for hex words 6
through 9 can mapped correctly and not display any useless information
in the "Error Details" section of the PEL.

Signed-off-by: Zane Shelley <zshelle@us.ibm.com>
Change-Id: I3bf439e5d886df92c90b6d8d13410bbcf485a14d
diff --git a/extensions/openpower-pels/registry.cpp b/extensions/openpower-pels/registry.cpp
index 3f4462f..2c66e0f 100644
--- a/extensions/openpower-pels/registry.cpp
+++ b/extensions/openpower-pels/registry.cpp
@@ -221,8 +221,13 @@
         }
 
         auto attributes = word.value();
+
+        // Use an empty string for the description if it does not exist.
+        auto itr = attributes.find("Description");
+        std::string desc = (attributes.end() != itr) ? *itr : "";
+
         std::tuple<std::string, std::string> adPropSourceDesc(
-            attributes["AdditionalDataPropSource"], attributes["Description"]);
+            attributes["AdditionalDataPropSource"], desc);
         hexwordFields[wordNum] = std::move(adPropSourceDesc);
     }