mirror of
https://github.com/GNS3/gns3-registry.git
synced 2024-12-19 04:47:54 +00:00
Better handle invalid files
This commit is contained in:
parent
519198eae0
commit
ba5464c4b4
7
build.py
7
build.py
@ -91,10 +91,17 @@ for device_file in os.listdir('devices'):
|
||||
# Resolve version image to the corresponding file
|
||||
for version in device['versions']:
|
||||
for image_type, filename in version['images'].items():
|
||||
found = False
|
||||
for file in device['images']:
|
||||
if file['filename'] == filename:
|
||||
version['images'][image_type] = copy.copy(file)
|
||||
version['images'][image_type]["type"] = image_type
|
||||
found = True
|
||||
break
|
||||
if not found:
|
||||
log.critical('Image for {} {} with filename {} is missing'.format(device["name"], version["name"], file['filename']))
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
render('device.html', os.path.join('devices', out_filename + '.html'), device=device)
|
||||
devices.append(device)
|
||||
|
Loading…
Reference in New Issue
Block a user