Pull in all registries
Before Redfish put all messages in Base, but as the Messages became more
specific Redfish started creating new registries. Redfish might have
went a little registry happy. HeartbeatEvent just has 1 message and all
these new ones registries each just have a handful of messages.
Add the remaining 15 registries:
composition, environmental, ethernetfabric, fabric, heartbeat_event,
job_event, license, logservice, networkdevice, platform, power,
sensor_event, storage_device, telemetry, update.
Some of these are wanted for both current development and future
development but it is hard to decide which ones so just added them all.
power, fabric, telemetry, update are all things we support today. Having
a UpdateInProgress or UpdateSuccessful makes a lot of sense and this
enables that.
Put these alphabetically. Use a new for loop to do this.
Make changes to scripts/parse_registries.py and run the tool.
No difference in size.
Before: 66928640 Apr 10 13:32
obmc-phosphor-image-p10bmc-20240410183051.ext4.mmc.tar
After: 66928640 Apr 10 13:18
obmc-phosphor-image-p10bmc-20240410181439.ext4.mmc.tar
Tested: bmcweb builds.
"./scripts/parse_registries.py --registries license,update" works.
Change-Id: I43b4d041531cf338e9e7e621714ca7d95f6b01a5
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/scripts/parse_registries.py b/scripts/parse_registries.py
index 696b09c..5001056 100755
--- a/scripts/parse_registries.py
+++ b/scripts/parse_registries.py
@@ -234,12 +234,42 @@
)
+def to_pascal_case(text):
+ s = text.replace("_", " ")
+ s = s.split()
+ if len(text) == 0:
+ return text
+ return "".join(i.capitalize() for i in s[0:])
+
+
def main():
+ dmtf_registries = (
+ ("base", "1.16.0"),
+ ("composition", "1.1.2"),
+ ("environmental", "1.0.1"),
+ ("ethernet_fabric", "1.0.1"),
+ ("fabric", "1.0.2"),
+ ("heartbeat_event", "1.0.1"),
+ ("job_event", "1.0.1"),
+ ("license", "1.0.3"),
+ ("log_service", "1.0.1"),
+ ("network_device", "1.0.3"),
+ ("platform", "1.0.1"),
+ ("power", "1.0.1"),
+ ("resource_event", "1.3.0"),
+ ("sensor_event", "1.0.1"),
+ ("storage_device", "1.2.1"),
+ ("task_event", "1.0.3"),
+ ("telemetry", "1.0.0"),
+ ("update", "1.0.2"),
+ )
+
parser = argparse.ArgumentParser()
parser.add_argument(
"--registries",
type=str,
- default="base,task_event,resource_event,privilege,openbmc",
+ default="privilege,openbmc,"
+ + ",".join([dmtf[0] for dmtf in dmtf_registries]),
help="Comma delimited list of registries to update",
)
@@ -248,28 +278,16 @@
registries = set(args.registries.split(","))
files = []
- if "base" in registries:
- files.append(
- make_getter(
- "Base.1.16.0.json", "base_message_registry.hpp", "base"
+ for registry, version in dmtf_registries:
+ if registry in registries:
+ registry_pascal_case = to_pascal_case(registry)
+ files.append(
+ make_getter(
+ f"{registry_pascal_case}.{version}.json",
+ f"{registry}_message_registry.hpp",
+ registry,
+ )
)
- )
- if "task_event" in registries:
- files.append(
- make_getter(
- "TaskEvent.1.0.3.json",
- "task_event_message_registry.hpp",
- "task_event",
- )
- )
- if "resource_event" in registries:
- files.append(
- make_getter(
- "ResourceEvent.1.3.0.json",
- "resource_event_message_registry.hpp",
- "resource_event",
- )
- )
if "openbmc" in registries:
files.append(openbmc_local_getter())