Make message registries use 2 digit versions
Redfish specification, section 9.5.11.2 says:
The MessageId property value shall be in the format:
<MessageRegistryPrefix>.<MajorVersion>.<MinorVersion>.<MessageKey>
bmcweb in certain places has incorrectly used the 3 digit version
instead of the 2 digit version. This commit fixes that by modifying the
parse_registries script to generate 3 separate struct entries to
represent the registry version, and parse them where appropriate.
MessageRegistryFileCollection uses the 3 digit version. No behavior
changes.
Message/event log entries use the 2 digit version. This will cause a
MessageId change from:
Base.1.19.0.InternalError
to
Base.1.19.InternalError
This is a breaking change, so a new option to allow the old behavior is
provided.
Tested: Redfish Service validator passes.
Heartbeat events on EventService show 2 digit versions.
Change-Id: I4165e994f73e200f13bed8ea76cb58bee2b69faa
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/scripts/parse_registries.py b/scripts/parse_registries.py
index 0311adb..5562120 100755
--- a/scripts/parse_registries.py
+++ b/scripts/parse_registries.py
@@ -81,18 +81,22 @@
print("{} not found".format(file))
with open(file, "w") as registry:
+
+ version_split = json_dict["RegistryVersion"].split(".")
+
registry.write(REGISTRY_HEADER.format(namespace))
# Parse the Registry header info
registry.write(
"const Header header = {{\n"
' "{json_dict[@Redfish.Copyright]}",\n'
' "{json_dict[@odata.type]}",\n'
- ' "{json_dict[Id]}",\n'
+ " {version_split[0]},\n"
+ " {version_split[1]},\n"
+ " {version_split[2]},\n"
' "{json_dict[Name]}",\n'
' "{json_dict[Language]}",\n'
' "{json_dict[Description]}",\n'
' "{json_dict[RegistryPrefix]}",\n'
- ' "{json_dict[RegistryVersion]}",\n'
' "{json_dict[OwningEntity]}",\n'
"}};\n"
"constexpr const char* url =\n"
@@ -102,6 +106,7 @@
"{{\n".format(
json_dict=json_dict,
url=url,
+ version_split=version_split,
)
)