format: reformat with latest openbmc-build-scripts
Reformat the repository using the latest from openbmc-build-scripts.
Add the `static/redfish` directory to be ignored by prettier since
these files come from elsewhere and having the ability to do a direct
diff is handy.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I74464d6f97047b4888a591e0d8a4f5ca970ac69e
diff --git a/scripts/update_schemas.py b/scripts/update_schemas.py
index da9c346..459d045 100755
--- a/scripts/update_schemas.py
+++ b/scripts/update_schemas.py
@@ -1,14 +1,13 @@
#!/usr/bin/env python3
-import requests
-import zipfile
-from io import BytesIO
-from packaging.version import parse
-
import os
-from collections import OrderedDict, defaultdict
import shutil
-
import xml.etree.ElementTree as ET
+import zipfile
+from collections import OrderedDict, defaultdict
+from io import BytesIO
+
+import requests
+from packaging.version import parse
VERSION = "DSP8010_2022.2"
@@ -42,7 +41,7 @@
"ComputerSystemCollection",
"Drive",
"DriveCollection",
- 'EnvironmentMetrics',
+ "EnvironmentMetrics",
"EthernetInterface",
"EthernetInterfaceCollection",
"Event",
@@ -254,7 +253,6 @@
csdl_filenames.sort(key=version_sort_key)
with open(metadata_index_path, "w") as metadata_index:
-
metadata_index.write('<?xml version="1.0" encoding="UTF-8"?>\n')
metadata_index.write(
"<edmx:Edmx xmlns:edmx="
@@ -270,7 +268,6 @@
continue
with open(os.path.join(schema_path, filename), "wb") as schema_out:
-
metadata_index.write(
' <edmx:Reference Uri="/redfish/v1/schema/'
+ filename
@@ -289,16 +286,14 @@
namespace = data_child.attrib["Namespace"]
if namespace.startswith("RedfishExtensions"):
metadata_index.write(
- " "
- '<edmx:Include Namespace="'
+ ' <edmx:Include Namespace="'
+ namespace
+ '" Alias="Redfish"/>\n'
)
else:
metadata_index.write(
- " "
- '<edmx:Include Namespace="'
+ ' <edmx:Include Namespace="'
+ namespace
+ '"/>\n'
)
@@ -392,6 +387,6 @@
for schema_file in json_schema_files:
hpp_file.write(' "{}",\n'.format(schema_file))
- hpp_file.write(" };\n" "}\n")
+ hpp_file.write(" };\n}\n")
zip_ref.close()