summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2021-06-10 02:24:19 +0300
committerEd Tanous <ed@tanous.net>2021-06-10 22:05:25 +0300
commit413d8767b84db1ef94146123638eae82016f04c3 (patch)
tree8718eca3432be2e424652f76321791fa457a0d01 /scripts
parent22db1728d5fdcac0a257976afa99034ae189c753 (diff)
downloadbmcweb-413d8767b84db1ef94146123638eae82016f04c3.tar.xz
Fix shadowing of parameter in scripts
The python registries script used the variable json, which conflicts with the "import json" module. This commit changes the name of the variable to json_dict, which is hopefully a more generic name: Tested: Ran script, observed same behavior. Registries are out of date, but will be updated in a later commit. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Icedc1d79ff5c9d8bfc8fe5eac96a1c6ea059272a
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/parse_registries.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/scripts/parse_registries.py b/scripts/parse_registries.py
index 155d77c070..4195236636 100755
--- a/scripts/parse_registries.py
+++ b/scripts/parse_registries.py
@@ -72,7 +72,7 @@ files.append(make_getter('ResourceEvent.1.0.3.json',
'resource_event_message_registry.hpp', 'resource_event'))
# Remove the old files
-for file, json, namespace, url in files:
+for file, json_dict, namespace, url in files:
try:
os.remove(file)
except BaseException:
@@ -82,22 +82,22 @@ for file, json, namespace, url in files:
registry.write(REGISTRY_HEADER.format(namespace))
# Parse the Registry header info
registry.write("const Header header = {")
- registry.write("\"{}\",".format(json["@Redfish.Copyright"]))
- registry.write("\"{}\",".format(json["@odata.type"]))
- registry.write("\"{}\",".format(json["Id"]))
- registry.write("\"{}\",".format(json["Name"]))
- registry.write("\"{}\",".format(json["Language"]))
- registry.write("\"{}\",".format(json["Description"]))
- registry.write("\"{}\",".format(json["RegistryPrefix"]))
- registry.write("\"{}\",".format(json["RegistryVersion"]))
- registry.write("\"{}\",".format(json["OwningEntity"]))
+ registry.write("\"{}\",".format(json_dict["@Redfish.Copyright"]))
+ registry.write("\"{}\",".format(json_dict["@odata.type"]))
+ registry.write("\"{}\",".format(json_dict["Id"]))
+ registry.write("\"{}\",".format(json_dict["Name"]))
+ registry.write("\"{}\",".format(json_dict["Language"]))
+ registry.write("\"{}\",".format(json_dict["Description"]))
+ registry.write("\"{}\",".format(json_dict["RegistryPrefix"]))
+ registry.write("\"{}\",".format(json_dict["RegistryVersion"]))
+ registry.write("\"{}\",".format(json_dict["OwningEntity"]))
registry.write("};")
registry.write('constexpr const char * url = "{}";\n\n'.format(url))
# Parse each Message entry
registry.write("constexpr std::array<MessageEntry, {}> registry = {{".format(
- len(json["Messages"])))
- for messageId, message in sorted(json["Messages"].items()):
+ len(json_dict["Messages"])))
+ for messageId, message in sorted(json_dict["Messages"].items()):
registry.write("MessageEntry{")
registry.write("\"{}\",".format(messageId))
registry.write("{")