blob: 29a40f154cbb75bef2874e3ce9e1a418608bb21c [file] [log] [blame]
Nan Zhou313c1b72022-03-25 11:47:55 -07001#!/usr/bin/env python3
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -06002import argparse
Jason M. Bills70304cb2019-03-27 12:03:59 -07003import json
Nan Zhou6eaf0bd2022-08-07 01:18:45 +00004import os
Ed Tanous42079ec2024-11-16 13:32:29 -08005from collections import OrderedDict
Jason M. Bills70304cb2019-03-27 12:03:59 -07006
Nan Zhou6eaf0bd2022-08-07 01:18:45 +00007import requests
Jason M. Bills70304cb2019-03-27 12:03:59 -07008
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -06009PRAGMA_ONCE = """#pragma once
10"""
Nan Zhou043bec02022-09-20 18:12:13 +000011
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -060012WARNING = """/****************************************************************
Ed Tanous1cf53df2022-02-17 09:09:25 -080013 * READ THIS WARNING FIRST
Jason M. Bills70304cb2019-03-27 12:03:59 -070014 * This is an auto-generated header which contains definitions
15 * for Redfish DMTF defined messages.
Ed Tanous1cf53df2022-02-17 09:09:25 -080016 * DO NOT modify this registry outside of running the
Jason M. Bills0e2d0692022-04-01 13:59:05 -070017 * parse_registries.py script. The definitions contained within
Ed Tanous1cf53df2022-02-17 09:09:25 -080018 * this file are owned by DMTF. Any modifications to these files
19 * should be first pushed to the relevant registry in the DMTF
20 * github organization.
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -060021 ***************************************************************/"""
Ed Tanous1cf53df2022-02-17 09:09:25 -080022
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -060023REGISTRY_HEADER = (
24 PRAGMA_ONCE
25 + WARNING
26 + """
Nan Zhou01c78a02022-09-20 18:17:20 +000027#include "registries.hpp"
28
29#include <array>
Jason M. Bills70304cb2019-03-27 12:03:59 -070030
Ed Tanous4d99bbb2022-02-17 10:02:57 -080031// clang-format off
32
Ed Tanousfffb8c12022-02-07 23:53:03 -080033namespace redfish::registries::{}
Jason M. Bills70304cb2019-03-27 12:03:59 -070034{{
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -060035"""
36)
Jason M. Bills70304cb2019-03-27 12:03:59 -070037
38SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
39
Jason M. Billsac706372020-02-18 11:36:47 -080040include_path = os.path.realpath(
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -060041 os.path.join(SCRIPT_DIR, "..", "redfish-core", "include", "registries")
42)
Jason M. Bills70304cb2019-03-27 12:03:59 -070043
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -060044proxies = {"https": os.environ.get("https_proxy", None)}
Jason M. Bills70304cb2019-03-27 12:03:59 -070045
Jason M. Bills70304cb2019-03-27 12:03:59 -070046
James Feiste51c7102020-03-17 10:38:18 -070047def make_getter(dmtf_name, header_name, type_name):
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -060048 url = "https://redfish.dmtf.org/registries/{}".format(dmtf_name)
James Feiste51c7102020-03-17 10:38:18 -070049 dmtf = requests.get(url, proxies=proxies)
50 dmtf.raise_for_status()
Ed Tanous42079ec2024-11-16 13:32:29 -080051 json_file = json.loads(dmtf.text, object_pairs_hook=OrderedDict)
James Feiste51c7102020-03-17 10:38:18 -070052 path = os.path.join(include_path, header_name)
53 return (path, json_file, type_name, url)
54
55
Ed Tanous3e5faba2023-08-16 15:11:29 -070056def openbmc_local_getter():
57 url = ""
58 with open(
59 os.path.join(
60 SCRIPT_DIR,
61 "..",
62 "redfish-core",
63 "include",
64 "registries",
65 "openbmc.json",
66 ),
67 "rb",
68 ) as json_file:
69 json_file = json.load(json_file)
70
71 path = os.path.join(include_path, "openbmc_message_registry.hpp")
72 return (path, json_file, "openbmc", url)
73
74
Nan Zhou49aa131f2022-09-20 18:41:37 +000075def update_registries(files):
76 # Remove the old files
77 for file, json_dict, namespace, url in files:
78 try:
79 os.remove(file)
80 except BaseException:
81 print("{} not found".format(file))
Jason M. Bills70304cb2019-03-27 12:03:59 -070082
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -060083 with open(file, "w") as registry:
Nan Zhou49aa131f2022-09-20 18:41:37 +000084 registry.write(REGISTRY_HEADER.format(namespace))
85 # Parse the Registry header info
Ed Tanous5b9ef702022-02-17 12:19:32 -080086 registry.write(
Nan Zhou49aa131f2022-09-20 18:41:37 +000087 "const Header header = {{\n"
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -060088 ' "{json_dict[@Redfish.Copyright]}",\n'
89 ' "{json_dict[@odata.type]}",\n'
90 ' "{json_dict[Id]}",\n'
91 ' "{json_dict[Name]}",\n'
92 ' "{json_dict[Language]}",\n'
93 ' "{json_dict[Description]}",\n'
94 ' "{json_dict[RegistryPrefix]}",\n'
95 ' "{json_dict[RegistryVersion]}",\n'
96 ' "{json_dict[OwningEntity]}",\n'
Nan Zhou49aa131f2022-09-20 18:41:37 +000097 "}};\n"
98 "constexpr const char* url =\n"
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -060099 ' "{url}";\n'
Nan Zhou49aa131f2022-09-20 18:41:37 +0000100 "\n"
101 "constexpr std::array registry =\n"
102 "{{\n".format(
103 json_dict=json_dict,
104 url=url,
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600105 )
106 )
Ed Tanous30a3c432022-02-07 09:37:21 -0800107
Nan Zhou49aa131f2022-09-20 18:41:37 +0000108 messages_sorted = sorted(json_dict["Messages"].items())
109 for messageId, message in messages_sorted:
110 registry.write(
111 " MessageEntry{{\n"
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600112 ' "{messageId}",\n'
Nan Zhou49aa131f2022-09-20 18:41:37 +0000113 " {{\n"
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600114 ' "{message[Description]}",\n'
115 ' "{message[Message]}",\n'
116 ' "{message[MessageSeverity]}",\n'
Nan Zhou49aa131f2022-09-20 18:41:37 +0000117 " {message[NumberOfArgs]},\n"
118 " {{".format(
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600119 messageId=messageId, message=message
120 )
121 )
Nan Zhou49aa131f2022-09-20 18:41:37 +0000122 paramTypes = message.get("ParamTypes")
123 if paramTypes:
124 for paramType in paramTypes:
125 registry.write(
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600126 '\n "{}",'.format(paramType)
Nan Zhou49aa131f2022-09-20 18:41:37 +0000127 )
128 registry.write("\n },\n")
129 else:
130 registry.write("},\n")
131 registry.write(
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600132 ' "{message[Resolution]}",\n'
133 " }}}},\n".format(message=message)
134 )
Nan Zhou49aa131f2022-09-20 18:41:37 +0000135
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600136 registry.write("\n};\n\nenum class Index\n{\n")
Nan Zhou49aa131f2022-09-20 18:41:37 +0000137 for index, (messageId, message) in enumerate(messages_sorted):
138 messageId = messageId[0].lower() + messageId[1:]
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600139 registry.write(" {} = {},\n".format(messageId, index))
Nan Zhou49aa131f2022-09-20 18:41:37 +0000140 registry.write(
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600141 "}};\n}} // namespace redfish::registries::{}\n".format(
142 namespace
143 )
144 )
Ed Tanoused398212021-06-09 17:05:54 -0700145
146
147def get_privilege_string_from_list(privilege_list):
148 privilege_string = "{{\n"
149 for privilege_json in privilege_list:
150 privileges = privilege_json["Privilege"]
151 privilege_string += " {"
152 for privilege in privileges:
153 if privilege == "NoAuth":
154 continue
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600155 privilege_string += '"'
Ed Tanoused398212021-06-09 17:05:54 -0700156 privilege_string += privilege
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600157 privilege_string += '",\n'
Ed Tanoused398212021-06-09 17:05:54 -0700158 if privilege != "NoAuth":
159 privilege_string = privilege_string[:-2]
160 privilege_string += "}"
161 privilege_string += ",\n"
162 privilege_string = privilege_string[:-2]
163 privilege_string += "\n}}"
164 return privilege_string
165
Ed Tanousf395daa2021-08-02 08:56:24 -0700166
Ed Tanoused398212021-06-09 17:05:54 -0700167def get_variable_name_for_privilege_set(privilege_list):
168 names = []
169 for privilege_json in privilege_list:
170 privileges = privilege_json["Privilege"]
171 names.append("And".join(privileges))
172 return "Or".join(names)
173
Ed Tanousf395daa2021-08-02 08:56:24 -0700174
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600175PRIVILEGE_HEADER = (
176 PRAGMA_ONCE
177 + WARNING
178 + """
Nan Zhou01c78a02022-09-20 18:17:20 +0000179#include "privileges.hpp"
180
181#include <array>
Nan Zhou043bec02022-09-20 18:12:13 +0000182
183// clang-format off
184
185namespace redfish::privileges
186{
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600187"""
188)
Nan Zhou043bec02022-09-20 18:12:13 +0000189
190
Ed Tanous42079ec2024-11-16 13:32:29 -0800191def get_old_index(entry):
192 old_order = [
193 "ResourceInUse",
194 "MalformedJSON",
195 "ResourceMissingAtURI",
196 "ActionParameterValueFormatError",
197 "ActionParameterValueNotInList",
198 "InternalError",
199 "UnrecognizedRequestBody",
200 "ResourceAtUriUnauthorized",
201 "ActionParameterUnknown",
202 "ResourceCannotBeDeleted",
203 "PropertyDuplicate",
204 "ServiceTemporarilyUnavailable",
205 "ResourceAlreadyExists",
206 "AccountForSessionNoLongerExists",
207 "CreateFailedMissingReqProperties",
208 "PropertyValueFormatError",
209 "PropertyValueNotInList",
210 "PropertyValueOutOfRange",
211 "ResourceAtUriInUnknownFormat",
212 "ServiceDisabled",
213 "ServiceInUnknownState",
214 "EventSubscriptionLimitExceeded",
215 "ActionParameterMissing",
216 "StringValueTooLong",
217 "SessionTerminated",
218 "SubscriptionTerminated",
219 "ResourceTypeIncompatible",
220 "ResetRequired",
221 "ChassisPowerStateOnRequired",
222 "ChassisPowerStateOffRequired",
223 "PropertyValueConflict",
224 "PropertyValueResourceConflict",
225 "PropertyValueExternalConflict",
226 "PropertyValueIncorrect",
227 "ResourceCreationConflict",
228 "MaximumErrorsExceeded",
229 "PreconditionFailed",
230 "PreconditionRequired",
231 "OperationFailed",
232 "OperationTimeout",
233 "PropertyValueTypeError",
234 "PropertyValueError",
235 "ResourceNotFound",
236 "CouldNotEstablishConnection",
237 "PropertyNotWritable",
238 "QueryParameterValueTypeError",
239 "ServiceShuttingDown",
240 "ActionParameterDuplicate",
241 "ActionParameterNotSupported",
242 "SourceDoesNotSupportProtocol",
243 "StrictAccountTypes",
244 "AccountRemoved",
245 "AccessDenied",
246 "QueryNotSupported",
247 "CreateLimitReachedForResource",
248 "GeneralError",
249 "Success",
250 "Created",
251 "NoOperation",
252 "PropertyUnknown",
253 "NoValidSession",
254 "InvalidObject",
255 "ResourceInStandby",
256 "ActionParameterValueTypeError",
257 "ActionParameterValueError",
258 "SessionLimitExceeded",
259 "ActionNotSupported",
260 "InvalidIndex",
261 "EmptyJSON",
262 "QueryNotSupportedOnResource",
263 "QueryNotSupportedOnOperation",
264 "QueryCombinationInvalid",
265 "EventBufferExceeded",
266 "InsufficientPrivilege",
267 "PropertyValueModified",
268 "AccountNotModified",
269 "QueryParameterValueFormatError",
270 "PropertyMissing",
271 "ResourceExhaustion",
272 "AccountModified",
273 "QueryParameterOutOfRange",
274 "PasswordChangeRequired",
275 "InvalidUpload",
276 "InsufficientStorage",
277 "OperationNotAllowed",
278 "ArraySizeTooLong",
279 "Invalid File",
280 "GenerateSecretKeyRequired",
281 ]
282
283 if entry[0] in old_order:
284 return old_order.index(entry[0])
285 else:
286 return 999999
287
288
289def create_error_registry(entry):
290
291 arg_as_url = {
292 "AccessDenied": [1],
293 "CouldNotEstablishConnection": [1],
294 "GenerateSecretKeyRequired": [1],
295 "InvalidObject": [1],
296 "PasswordChangeRequired": [1],
297 "PropertyValueResourceConflict": [3],
298 "ResetRequired": [1],
299 "ResourceAtUriInUnknownFormat": [1],
300 "ResourceAtUriUnauthorized": [1],
301 "ResourceCreationConflict": [1],
302 "ResourceMissingAtURI": [1],
303 "SourceDoesNotSupportProtocol": [1],
304 }
305
306 arg_as_json = {
307 "ActionParameterValueError": [1],
308 "ActionParameterValueFormatError": [1],
309 "ActionParameterValueTypeError": [1],
310 "PropertyValueExternalConflict": [2],
311 "PropertyValueFormatError": [1],
312 "PropertyValueIncorrect": [2],
313 "PropertyValueModified": [2],
314 "PropertyValueNotInList": [1],
315 "PropertyValueOutOfRange": [1],
316 "PropertyValueResourceConflict": [2],
317 "PropertyValueTypeError": [1],
318 "QueryParameterValueFormatError": [1],
319 "QueryParameterValueTypeError": [1],
320 }
321
322 arg_as_int = {
323 "StringValueTooLong": [2],
324 }
325
326 arg_as_uint64 = {
327 "ArraySizeTooLong": [2],
328 }
329 arg_as_int64 = {
330 "InvalidIndex": [1],
331 }
332
333 file, json_dict, namespace, url = entry
334
335 # Note, this message doesn't exist in DMTF. Needs cleaned up at some point
336 json_dict["Messages"]["InvalidUpload"] = {
337 "Message": "Invalid file uploaded to %1: %2.*",
338 "ParamTypes": ["string", "string"],
339 }
340
341 messages = OrderedDict(
342 sorted(json_dict["Messages"].items(), key=get_old_index)
343 )
344 error_messages_hpp = os.path.join(
345 SCRIPT_DIR, "..", "redfish-core", "include", "error_messages.hpp"
346 )
347 with open(
348 error_messages_hpp,
349 "w",
350 ) as out:
351 out.write(PRAGMA_ONCE)
352 out.write(WARNING)
353 out.write(
354 """
355
356#include "http_response.hpp"
357
358#include <boost/url/url_view_base.hpp>
359#include <nlohmann/json.hpp>
360
361#include <cstdint>
362#include <source_location>
363#include <string>
364#include <string_view>
365
366// IWYU pragma: no_forward_declare crow::Response
367
368namespace redfish
369{
370
371namespace messages
372{
373
374 constexpr const char* messageVersionPrefix = "Base.1.11.0.";
375 constexpr const char* messageAnnotation = "@Message.ExtendedInfo";
376
377 /**
378 * @brief Moves all error messages from the |source| JSON to |target|
379 */
380 void moveErrorsToErrorJson(nlohmann::json& target, nlohmann::json& source);
381
382"""
383 )
384
385 for entry_id, entry in messages.items():
386 message = entry["Message"]
387 for index in range(1, 10):
388 message = message.replace(f"'%{index}'", f"<arg{index}>")
389 message = message.replace(f"%{index}", f"<arg{index}>")
390
391 out.write("/**\n")
392 out.write(f"* @brief Formats {entry_id} message into JSON\n")
393 out.write(f'* Message body: "{message}"\n')
394 out.write("*\n")
395 arg_index = 0
396 for arg_index, arg in enumerate(entry.get("ParamTypes", [])):
397 arg_index += 1
398
399 out.write(
400 f"* @param[in] arg{arg_index} Parameter of message that will replace %{arg_index} in its body.\n"
401 )
402 out.write("*\n")
403 out.write(f"* @returns Message {entry_id} formatted to JSON */\n")
404
405 args = []
406 for arg_index, arg in enumerate(entry.get("ParamTypes", [])):
407 arg_index += 1
408 if arg_index in arg_as_url.get(entry_id, []):
409 typename = "const boost::urls::url_view_base&"
410 elif arg_index in arg_as_json.get(entry_id, []):
411 typename = "const nlohmann::json&"
412 elif arg_index in arg_as_int.get(entry_id, []):
413 typename = "int"
414 elif arg_index in arg_as_uint64.get(entry_id, []):
415 typename = "uint64_t"
416 elif arg_index in arg_as_int64.get(entry_id, []):
417 typename = "int64_t"
418 else:
419 typename = "std::string_view"
420 args.append(f"{typename} arg{arg_index}")
421 function_name = entry_id[0].lower() + entry_id[1:]
422 arg = ", ".join(args)
423 out.write(f"nlohmann::json {function_name}({arg});\n\n")
424 args.insert(0, "crow::Response& res")
425 if entry_id == "InternalError":
426 args.append(
427 "std::source_location location = std::source_location::current()"
428 )
429 arg = ", ".join(args)
430 out.write(f"void {function_name}({arg});\n\n")
431 out.write(" }\n")
432 out.write("}\n")
433 os.system(f"clang-format -i {error_messages_hpp}")
434
435
Ed Tanoused398212021-06-09 17:05:54 -0700436def make_privilege_registry():
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600437 path, json_file, type_name, url = make_getter(
Gunnar Mills5910d942024-04-16 12:07:17 -0500438 "Redfish_1.5.0_PrivilegeRegistry.json",
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600439 "privilege_registry.hpp",
440 "privilege",
441 )
442 with open(path, "w") as registry:
Nan Zhou043bec02022-09-20 18:12:13 +0000443 registry.write(PRIVILEGE_HEADER)
Ed Tanoused398212021-06-09 17:05:54 -0700444
445 privilege_dict = {}
446 for mapping in json_file["Mappings"]:
447 # first pass, identify all the unique privilege sets
448 for operation, privilege_list in mapping["OperationMap"].items():
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600449 privilege_dict[
450 get_privilege_string_from_list(privilege_list)
451 ] = (privilege_list,)
Ed Tanoused398212021-06-09 17:05:54 -0700452 for index, key in enumerate(privilege_dict):
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600453 (privilege_list,) = privilege_dict[key]
Ed Tanoused398212021-06-09 17:05:54 -0700454 name = get_variable_name_for_privilege_set(privilege_list)
Ed Tanousf395daa2021-08-02 08:56:24 -0700455 registry.write(
Ed Tanous5b9ef702022-02-17 12:19:32 -0800456 "const std::array<Privileges, {length}> "
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600457 "privilegeSet{name} = {key};\n".format(
458 length=len(privilege_list), name=name, key=key
459 )
Ed Tanous5b9ef702022-02-17 12:19:32 -0800460 )
Ed Tanoused398212021-06-09 17:05:54 -0700461 privilege_dict[key] = (privilege_list, name)
Ed Tanoused398212021-06-09 17:05:54 -0700462
463 for mapping in json_file["Mappings"]:
464 entity = mapping["Entity"]
Ed Tanous4d99bbb2022-02-17 10:02:57 -0800465 registry.write("// {}\n".format(entity))
Ed Tanoused398212021-06-09 17:05:54 -0700466 for operation, privilege_list in mapping["OperationMap"].items():
467 privilege_string = get_privilege_string_from_list(
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600468 privilege_list
469 )
Ed Tanoused398212021-06-09 17:05:54 -0700470 operation = operation.lower()
471
Ed Tanousf395daa2021-08-02 08:56:24 -0700472 registry.write(
473 "const static auto& {}{} = privilegeSet{};\n".format(
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600474 operation, entity, privilege_dict[privilege_string][1]
475 )
476 )
Ed Tanoused398212021-06-09 17:05:54 -0700477 registry.write("\n")
Ed Tanous5b9ef702022-02-17 12:19:32 -0800478 registry.write(
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600479 "} // namespace redfish::privileges\n// clang-format on\n"
480 )
Ed Tanoused398212021-06-09 17:05:54 -0700481
482
Gunnar Mills665e7602024-04-10 13:14:41 -0500483def to_pascal_case(text):
484 s = text.replace("_", " ")
485 s = s.split()
486 if len(text) == 0:
487 return text
488 return "".join(i.capitalize() for i in s[0:])
489
490
Nan Zhou49aa131f2022-09-20 18:41:37 +0000491def main():
Gunnar Mills665e7602024-04-10 13:14:41 -0500492 dmtf_registries = (
Jishnu CMb575cae2024-10-01 01:33:49 -0500493 ("base", "1.19.0"),
Gunnar Mills665e7602024-04-10 13:14:41 -0500494 ("composition", "1.1.2"),
495 ("environmental", "1.0.1"),
496 ("ethernet_fabric", "1.0.1"),
497 ("fabric", "1.0.2"),
498 ("heartbeat_event", "1.0.1"),
499 ("job_event", "1.0.1"),
500 ("license", "1.0.3"),
501 ("log_service", "1.0.1"),
502 ("network_device", "1.0.3"),
503 ("platform", "1.0.1"),
504 ("power", "1.0.1"),
505 ("resource_event", "1.3.0"),
506 ("sensor_event", "1.0.1"),
507 ("storage_device", "1.2.1"),
508 ("task_event", "1.0.3"),
509 ("telemetry", "1.0.0"),
510 ("update", "1.0.2"),
511 )
512
Nan Zhou49aa131f2022-09-20 18:41:37 +0000513 parser = argparse.ArgumentParser()
514 parser.add_argument(
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600515 "--registries",
516 type=str,
Gunnar Mills665e7602024-04-10 13:14:41 -0500517 default="privilege,openbmc,"
518 + ",".join([dmtf[0] for dmtf in dmtf_registries]),
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600519 help="Comma delimited list of registries to update",
520 )
Nan Zhou49aa131f2022-09-20 18:41:37 +0000521
522 args = parser.parse_args()
523
524 registries = set(args.registries.split(","))
525 files = []
526
Gunnar Mills665e7602024-04-10 13:14:41 -0500527 for registry, version in dmtf_registries:
528 if registry in registries:
529 registry_pascal_case = to_pascal_case(registry)
530 files.append(
531 make_getter(
532 f"{registry_pascal_case}.{version}.json",
533 f"{registry}_message_registry.hpp",
534 registry,
535 )
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600536 )
Ed Tanous3e5faba2023-08-16 15:11:29 -0700537 if "openbmc" in registries:
538 files.append(openbmc_local_getter())
Nan Zhou49aa131f2022-09-20 18:41:37 +0000539
540 update_registries(files)
541
Ed Tanous42079ec2024-11-16 13:32:29 -0800542 create_error_registry(files[0])
543
Nan Zhou49aa131f2022-09-20 18:41:37 +0000544 if "privilege" in registries:
545 make_privilege_registry()
546
547
548if __name__ == "__main__":
549 main()