blob: 194f134455b1fc067d523201a17588413bff44c1 [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",
Ed Tanous42079ec2024-11-16 13:32:29 -0800275 "InsufficientStorage",
276 "OperationNotAllowed",
277 "ArraySizeTooLong",
278 "Invalid File",
279 "GenerateSecretKeyRequired",
280 ]
281
282 if entry[0] in old_order:
283 return old_order.index(entry[0])
284 else:
285 return 999999
286
287
288def create_error_registry(entry):
289
290 arg_as_url = {
291 "AccessDenied": [1],
292 "CouldNotEstablishConnection": [1],
293 "GenerateSecretKeyRequired": [1],
294 "InvalidObject": [1],
295 "PasswordChangeRequired": [1],
296 "PropertyValueResourceConflict": [3],
297 "ResetRequired": [1],
298 "ResourceAtUriInUnknownFormat": [1],
299 "ResourceAtUriUnauthorized": [1],
300 "ResourceCreationConflict": [1],
301 "ResourceMissingAtURI": [1],
302 "SourceDoesNotSupportProtocol": [1],
303 }
304
305 arg_as_json = {
306 "ActionParameterValueError": [1],
307 "ActionParameterValueFormatError": [1],
308 "ActionParameterValueTypeError": [1],
309 "PropertyValueExternalConflict": [2],
310 "PropertyValueFormatError": [1],
311 "PropertyValueIncorrect": [2],
312 "PropertyValueModified": [2],
313 "PropertyValueNotInList": [1],
314 "PropertyValueOutOfRange": [1],
315 "PropertyValueResourceConflict": [2],
316 "PropertyValueTypeError": [1],
317 "QueryParameterValueFormatError": [1],
318 "QueryParameterValueTypeError": [1],
319 }
320
321 arg_as_int = {
322 "StringValueTooLong": [2],
323 }
324
325 arg_as_uint64 = {
326 "ArraySizeTooLong": [2],
327 }
328 arg_as_int64 = {
329 "InvalidIndex": [1],
330 }
331
332 file, json_dict, namespace, url = entry
333
Ed Tanous42079ec2024-11-16 13:32:29 -0800334 messages = OrderedDict(
335 sorted(json_dict["Messages"].items(), key=get_old_index)
336 )
337 error_messages_hpp = os.path.join(
338 SCRIPT_DIR, "..", "redfish-core", "include", "error_messages.hpp"
339 )
340 with open(
341 error_messages_hpp,
342 "w",
343 ) as out:
344 out.write(PRAGMA_ONCE)
345 out.write(WARNING)
346 out.write(
347 """
348
349#include "http_response.hpp"
350
351#include <boost/url/url_view_base.hpp>
352#include <nlohmann/json.hpp>
353
354#include <cstdint>
355#include <source_location>
356#include <string>
357#include <string_view>
Ed Tanousc87294a2024-11-16 22:17:12 -0800358#include <utility>
Ed Tanous42079ec2024-11-16 13:32:29 -0800359
360// IWYU pragma: no_forward_declare crow::Response
361
362namespace redfish
363{
364
365namespace messages
366{
367
368 constexpr const char* messageVersionPrefix = "Base.1.11.0.";
369 constexpr const char* messageAnnotation = "@Message.ExtendedInfo";
370
371 /**
372 * @brief Moves all error messages from the |source| JSON to |target|
373 */
374 void moveErrorsToErrorJson(nlohmann::json& target, nlohmann::json& source);
375
376"""
377 )
378
379 for entry_id, entry in messages.items():
380 message = entry["Message"]
381 for index in range(1, 10):
382 message = message.replace(f"'%{index}'", f"<arg{index}>")
383 message = message.replace(f"%{index}", f"<arg{index}>")
384
385 out.write("/**\n")
386 out.write(f"* @brief Formats {entry_id} message into JSON\n")
387 out.write(f'* Message body: "{message}"\n')
388 out.write("*\n")
389 arg_index = 0
390 for arg_index, arg in enumerate(entry.get("ParamTypes", [])):
391 arg_index += 1
392
393 out.write(
394 f"* @param[in] arg{arg_index} Parameter of message that will replace %{arg_index} in its body.\n"
395 )
396 out.write("*\n")
397 out.write(f"* @returns Message {entry_id} formatted to JSON */\n")
398
399 args = []
400 for arg_index, arg in enumerate(entry.get("ParamTypes", [])):
401 arg_index += 1
402 if arg_index in arg_as_url.get(entry_id, []):
403 typename = "const boost::urls::url_view_base&"
404 elif arg_index in arg_as_json.get(entry_id, []):
405 typename = "const nlohmann::json&"
406 elif arg_index in arg_as_int.get(entry_id, []):
407 typename = "int"
408 elif arg_index in arg_as_uint64.get(entry_id, []):
409 typename = "uint64_t"
410 elif arg_index in arg_as_int64.get(entry_id, []):
411 typename = "int64_t"
412 else:
413 typename = "std::string_view"
414 args.append(f"{typename} arg{arg_index}")
415 function_name = entry_id[0].lower() + entry_id[1:]
416 arg = ", ".join(args)
417 out.write(f"nlohmann::json {function_name}({arg});\n\n")
418 args.insert(0, "crow::Response& res")
419 if entry_id == "InternalError":
420 args.append(
421 "std::source_location location = std::source_location::current()"
422 )
423 arg = ", ".join(args)
424 out.write(f"void {function_name}({arg});\n\n")
425 out.write(" }\n")
426 out.write("}\n")
427 os.system(f"clang-format -i {error_messages_hpp}")
428
429
Ed Tanoused398212021-06-09 17:05:54 -0700430def make_privilege_registry():
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600431 path, json_file, type_name, url = make_getter(
Gunnar Mills5910d942024-04-16 12:07:17 -0500432 "Redfish_1.5.0_PrivilegeRegistry.json",
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600433 "privilege_registry.hpp",
434 "privilege",
435 )
436 with open(path, "w") as registry:
Nan Zhou043bec02022-09-20 18:12:13 +0000437 registry.write(PRIVILEGE_HEADER)
Ed Tanoused398212021-06-09 17:05:54 -0700438
439 privilege_dict = {}
440 for mapping in json_file["Mappings"]:
441 # first pass, identify all the unique privilege sets
442 for operation, privilege_list in mapping["OperationMap"].items():
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600443 privilege_dict[
444 get_privilege_string_from_list(privilege_list)
445 ] = (privilege_list,)
Ed Tanoused398212021-06-09 17:05:54 -0700446 for index, key in enumerate(privilege_dict):
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600447 (privilege_list,) = privilege_dict[key]
Ed Tanoused398212021-06-09 17:05:54 -0700448 name = get_variable_name_for_privilege_set(privilege_list)
Ed Tanousf395daa2021-08-02 08:56:24 -0700449 registry.write(
Ed Tanous5b9ef702022-02-17 12:19:32 -0800450 "const std::array<Privileges, {length}> "
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600451 "privilegeSet{name} = {key};\n".format(
452 length=len(privilege_list), name=name, key=key
453 )
Ed Tanous5b9ef702022-02-17 12:19:32 -0800454 )
Ed Tanoused398212021-06-09 17:05:54 -0700455 privilege_dict[key] = (privilege_list, name)
Ed Tanoused398212021-06-09 17:05:54 -0700456
457 for mapping in json_file["Mappings"]:
458 entity = mapping["Entity"]
Ed Tanous4d99bbb2022-02-17 10:02:57 -0800459 registry.write("// {}\n".format(entity))
Ed Tanoused398212021-06-09 17:05:54 -0700460 for operation, privilege_list in mapping["OperationMap"].items():
461 privilege_string = get_privilege_string_from_list(
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600462 privilege_list
463 )
Ed Tanoused398212021-06-09 17:05:54 -0700464 operation = operation.lower()
465
Ed Tanousf395daa2021-08-02 08:56:24 -0700466 registry.write(
467 "const static auto& {}{} = privilegeSet{};\n".format(
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600468 operation, entity, privilege_dict[privilege_string][1]
469 )
470 )
Ed Tanoused398212021-06-09 17:05:54 -0700471 registry.write("\n")
Ed Tanous5b9ef702022-02-17 12:19:32 -0800472 registry.write(
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600473 "} // namespace redfish::privileges\n// clang-format on\n"
474 )
Ed Tanoused398212021-06-09 17:05:54 -0700475
476
Gunnar Mills665e7602024-04-10 13:14:41 -0500477def to_pascal_case(text):
478 s = text.replace("_", " ")
479 s = s.split()
480 if len(text) == 0:
481 return text
482 return "".join(i.capitalize() for i in s[0:])
483
484
Nan Zhou49aa131f2022-09-20 18:41:37 +0000485def main():
Gunnar Mills665e7602024-04-10 13:14:41 -0500486 dmtf_registries = (
Jishnu CMb575cae2024-10-01 01:33:49 -0500487 ("base", "1.19.0"),
Gunnar Mills665e7602024-04-10 13:14:41 -0500488 ("composition", "1.1.2"),
489 ("environmental", "1.0.1"),
490 ("ethernet_fabric", "1.0.1"),
491 ("fabric", "1.0.2"),
492 ("heartbeat_event", "1.0.1"),
493 ("job_event", "1.0.1"),
494 ("license", "1.0.3"),
495 ("log_service", "1.0.1"),
496 ("network_device", "1.0.3"),
497 ("platform", "1.0.1"),
498 ("power", "1.0.1"),
499 ("resource_event", "1.3.0"),
500 ("sensor_event", "1.0.1"),
501 ("storage_device", "1.2.1"),
502 ("task_event", "1.0.3"),
503 ("telemetry", "1.0.0"),
504 ("update", "1.0.2"),
505 )
506
Nan Zhou49aa131f2022-09-20 18:41:37 +0000507 parser = argparse.ArgumentParser()
508 parser.add_argument(
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600509 "--registries",
510 type=str,
Gunnar Mills665e7602024-04-10 13:14:41 -0500511 default="privilege,openbmc,"
512 + ",".join([dmtf[0] for dmtf in dmtf_registries]),
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600513 help="Comma delimited list of registries to update",
514 )
Nan Zhou49aa131f2022-09-20 18:41:37 +0000515
516 args = parser.parse_args()
517
518 registries = set(args.registries.split(","))
519 files = []
520
Gunnar Mills665e7602024-04-10 13:14:41 -0500521 for registry, version in dmtf_registries:
522 if registry in registries:
523 registry_pascal_case = to_pascal_case(registry)
524 files.append(
525 make_getter(
526 f"{registry_pascal_case}.{version}.json",
527 f"{registry}_message_registry.hpp",
528 registry,
529 )
Patrick Williamsdfa3fdc2022-12-07 07:14:21 -0600530 )
Ed Tanous3e5faba2023-08-16 15:11:29 -0700531 if "openbmc" in registries:
532 files.append(openbmc_local_getter())
Nan Zhou49aa131f2022-09-20 18:41:37 +0000533
534 update_registries(files)
535
Ed Tanous42079ec2024-11-16 13:32:29 -0800536 create_error_registry(files[0])
537
Nan Zhou49aa131f2022-09-20 18:41:37 +0000538 if "privilege" in registries:
539 make_privilege_registry()
540
541
542if __name__ == "__main__":
543 main()