PEL: Create python package for msg registry
There is, or rather soon will be, a python tool to decode PELs that runs
on platforms other than the BMC. It needs access to the message
registry so it can display an error message for a PEL created by the
BMC.
To support this, create a python package called pel-message-registry
that will hold the message registry and component name files and provide
functions to access them:
import pel_registry
reg = pel_registry.get_registry_path()
compIDs = pel_registry.get_comp_id_file_path(creatorID)
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I5aa2ddc27e74aa81485c87141569ebef2901c800
diff --git a/extensions/openpower-pels/pel_registry/__init__.py b/extensions/openpower-pels/pel_registry/__init__.py
new file mode 100644
index 0000000..32585bd
--- /dev/null
+++ b/extensions/openpower-pels/pel_registry/__init__.py
@@ -0,0 +1,11 @@
+import os
+
+
+def get_registry_path() -> str:
+ return os.path.join(os.path.dirname(__file__),
+ 'message_registry.json')
+
+
+def get_comp_id_file_path(creatorID: str) -> str:
+ return os.path.join(os.path.dirname(__file__),
+ creatorID + '_component_ids.json')