Generate OpenBMC registry
We haven't been very good about maintaining this file, so lets generate
it like we do everything else.
This commit takes the existing, manually built
openbmc_message_registry.hpp and copies the generated json from a
working system, then hooks it into the parse_registries script to
generate the hpp file. This results in a couple changes, and somewhat
proves how bad our ability to manage this file manually is..
Tested: Looking for input on if this is the right direction.
Change-Id: I5dc03021d194f0674e4a8f41421096b211462a0a
Signed-off-by: Ed Tanous <edtanous@google.com>
diff --git a/scripts/parse_registries.py b/scripts/parse_registries.py
index 3f1fd27..696b09c 100755
--- a/scripts/parse_registries.py
+++ b/scripts/parse_registries.py
@@ -52,6 +52,25 @@
return (path, json_file, type_name, url)
+def openbmc_local_getter():
+ url = ""
+ with open(
+ os.path.join(
+ SCRIPT_DIR,
+ "..",
+ "redfish-core",
+ "include",
+ "registries",
+ "openbmc.json",
+ ),
+ "rb",
+ ) as json_file:
+ json_file = json.load(json_file)
+
+ path = os.path.join(include_path, "openbmc_message_registry.hpp")
+ return (path, json_file, "openbmc", url)
+
+
def update_registries(files):
# Remove the old files
for file, json_dict, namespace, url in files:
@@ -220,7 +239,7 @@
parser.add_argument(
"--registries",
type=str,
- default="base,task_event,resource_event,privilege",
+ default="base,task_event,resource_event,privilege,openbmc",
help="Comma delimited list of registries to update",
)
@@ -251,6 +270,8 @@
"resource_event",
)
)
+ if "openbmc" in registries:
+ files.append(openbmc_local_getter())
update_registries(files)