From 3e5faba56da7ac0cbb7eb2c51d521285775cda12 Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Wed, 16 Aug 2023 15:11:29 -0700 Subject: 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 --- scripts/parse_registries.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/parse_registries.py b/scripts/parse_registries.py index 3f1fd27e72..696b09c78a 100755 --- a/scripts/parse_registries.py +++ b/scripts/parse_registries.py @@ -52,6 +52,25 @@ def make_getter(dmtf_name, header_name, type_name): 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 @@ def main(): 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 @@ def main(): "resource_event", ) ) + if "openbmc" in registries: + files.append(openbmc_local_getter()) update_registries(files) -- cgit v1.2.3