Fix appliance schema v8, adapt check.py for schema v8

This commit is contained in:
Bernhard Ehlers 2024-07-07 16:40:32 +02:00
parent 8cf5ed4c04
commit d990ad1b80
No known key found for this signature in database
2 changed files with 169 additions and 168 deletions

View File

@ -96,8 +96,9 @@ def check_appliance(appliance):
if image['filename'] in images: if image['filename'] in images:
print('Duplicate image filename ' + image['filename']) print('Duplicate image filename ' + image['filename'])
warnings += 1 warnings += 1
if image['md5sum'] in md5sums: md5sum = image.get('checksum') or image.get('md5sum')
print('Duplicate image md5sum ' + image['md5sum']) if md5sum in md5sums:
print('Duplicate image md5sum ' + md5sum)
sys.exit(1) sys.exit(1)
versions_found = False versions_found = False
for version in appliance_json['versions']: for version in appliance_json['versions']:
@ -107,7 +108,7 @@ def check_appliance(appliance):
print('Unused image ' + image['filename'] + ' in ' + appliance) print('Unused image ' + image['filename'] + ' in ' + appliance)
warnings += 1 warnings += 1
images[image['filename']] = image['version'] images[image['filename']] = image['version']
md5sums.add(image['md5sum']) md5sums.add(md5sum)
for version in appliance_json['versions']: for version in appliance_json['versions']:
version_match = False version_match = False

View File

@ -720,7 +720,6 @@
"template_properties" "template_properties"
] ]
} }
}
}, },
"images": { "images": {
"type": "array", "type": "array",
@ -889,6 +888,7 @@
"name" "name"
] ]
} }
}
}, },
"required": [ "required": [
"appliance_id", "appliance_id",