summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGunnar Mills <gmills@us.ibm.com>2021-01-21 07:29:16 +0300
committerGunnar Mills <gmills@us.ibm.com>2021-01-26 18:39:13 +0300
commit349a2ac3921e17ff0e2bce47ba6698112d586e67 (patch)
treee6a97c4b6f89d42d1cfc310e5a3ee280a95a24d7 /scripts
parent262d7d4ba6b43ede7edde97765f7d710f29c862f (diff)
downloadbmcweb-349a2ac3921e17ff0e2bce47ba6698112d586e67.tar.xz
Exclude not used schemas
Created a list of all used schemas, and a few being added for use in reviews now. Exclude all other schemas. Developers if they wish to use a new schema will have to add it to this list and rerun update_schemas.py. Size of obmc-phosphor-image-witherspoon-<date>.rootfs.squashfs-xz: Before 2020.4: 19451904 With 2020.4, before this commit: 19492864 With this commit: 19275776 Tested: Validator passes. Change-Id: I23272049aa38c51ac7af0d3b0f5b4641a349a487 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/update_schemas.py106
1 files changed, 106 insertions, 0 deletions
diff --git a/scripts/update_schemas.py b/scripts/update_schemas.py
index 43d563afd2..315522cea7 100755
--- a/scripts/update_schemas.py
+++ b/scripts/update_schemas.py
@@ -14,6 +14,100 @@ import xml.etree.ElementTree as ET
VERSION = "DSP8010_2020.4"
+# To use a new schema, add to list and rerun tool
+include_list = [
+ 'AccountService',
+ 'ActionInfo',
+ 'Assembly',
+ 'AttributeRegistry',
+ 'Bios',
+ 'Certificate',
+ 'CertificateCollection',
+ 'CertificateLocations',
+ 'CertificateService',
+ 'Chassis',
+ 'ChassisCollection',
+ 'ComputerSystem',
+ 'ComputerSystemCollection',
+ 'Drive',
+ 'DriveCollection',
+ 'EthernetInterface',
+ 'EthernetInterfaceCollection',
+ 'Event',
+ 'EventDestination',
+ 'EventDestinationCollection',
+ 'EventService',
+ 'IPAddresses',
+ 'JsonSchemaFile',
+ 'JsonSchemaFileCollection', #redfish/v1/JsonSchemas
+ 'LogEntry',
+ 'LogEntryCollection',
+ 'LogService',
+ 'LogServiceCollection',
+ 'Manager',
+ 'ManagerAccount',
+ 'ManagerAccountCollection',
+ 'ManagerCollection',
+ 'ManagerNetworkProtocol',
+ 'Memory',
+ 'MemoryCollection',
+ 'Message',
+ 'MessageRegistry',
+ 'MessageRegistryCollection',
+ 'MessageRegistryFile',
+ 'MessageRegistryFileCollection',
+ 'MetricDefinition',
+ 'MetricDefinitionCollection',
+ 'MetricReport',
+ 'MetricReportCollection',
+ 'MetricReportDefinition',
+ 'MetricReportDefinitionCollection',
+ 'OperatingConfig',
+ 'OperatingConfigCollection',
+ 'PCIeDevice',
+ 'PCIeDeviceCollection',
+ 'PCIeFunction',
+ 'PCIeFunctionCollection',
+ 'Power',
+ 'Processor',
+ 'ProcessorCollection',
+ 'RedfishError',
+ 'RedfishExtensions',
+ 'Redundancy',
+ 'Resource',
+ 'Role',
+ 'RoleCollection',
+ 'Sensor',
+ 'SensorCollection',
+ 'ServiceRoot',
+ 'Session',
+ 'SessionCollection',
+ 'SessionService',
+ 'Settings',
+ 'SoftwareInventory',
+ 'SoftwareInventoryCollection',
+ 'Storage',
+ 'StorageCollection',
+ 'StorageController',
+ 'StorageControllerCollection',
+ 'Task',
+ 'TaskCollection',
+ 'TaskService',
+ 'TelemetryService',
+ 'Thermal',
+ 'UpdateService',
+ 'VLanNetworkInterfaceCollection',
+ 'VLanNetworkInterface',
+ 'VirtualMedia',
+ 'VirtualMediaCollection',
+ 'odata',
+ 'odata-v4',
+ 'redfish-error',
+ 'redfish-payload-annotations',
+ 'redfish-schema',
+ 'redfish-schema-v1',
+]
+
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
proxies = {
@@ -69,6 +163,13 @@ with open(metadata_index_path, 'w') as metadata_index:
"/csdl/") & (zip_filepath != VERSION +
"/csdl/"):
filename = os.path.basename(zip_filepath)
+
+ # filename looks like Zone_v1.xml
+ filenamesplit = filename.split("_")
+ if filenamesplit[0] not in include_list:
+ print("excluding schema: " + filename)
+ continue
+
with open(os.path.join(schema_path, filename), 'wb') as schema_file:
metadata_index.write(
@@ -146,6 +247,11 @@ for zip_filepath in zip_ref.namelist():
if zip_filepath.startswith(os.path.join(VERSION, 'json-schema/')):
filename = os.path.basename(zip_filepath)
filenamesplit = filename.split(".")
+
+ # exclude schemas again to save flash space
+ if filenamesplit[0] not in include_list:
+ continue
+
if len(filenamesplit) == 3:
thisSchemaVersion = schema_files.get(filenamesplit[0], None)
if thisSchemaVersion is None: