summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2023-08-17 01:11:29 +0300
committerEd Tanous <ed@tanous.net>2023-09-21 18:52:23 +0300
commit3e5faba56da7ac0cbb7eb2c51d521285775cda12 (patch)
tree86d9be84c432f66922eb5aebb9018f9855ab41db /scripts
parente1bf8bb6a843a2a53d74d74f410b5fe053c2d222 (diff)
downloadbmcweb-3e5faba56da7ac0cbb7eb2c51d521285775cda12.tar.xz
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>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/parse_registries.py23
1 files changed, 22 insertions, 1 deletions
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)