mirror of
https://github.com/GNS3/gns3-registry.git
synced 2025-01-31 16:35:29 +00:00
Merge pull request #123 from ehlers/master
check_urls: 'images' property is now optional, handle Ctrl-C
This commit is contained in:
commit
9e0e455052
@ -17,12 +17,19 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
|
import signal
|
||||||
import sys
|
import sys
|
||||||
import pycurl
|
import pycurl
|
||||||
|
|
||||||
err_list = []
|
err_list = []
|
||||||
|
|
||||||
|
|
||||||
|
def handle_ctrl_c(signal, frame):
|
||||||
|
print("Got Ctrl-C, terminating!")
|
||||||
|
sys.exit(1)
|
||||||
|
signal.signal(signal.SIGINT, handle_ctrl_c)
|
||||||
|
|
||||||
|
|
||||||
def data_abort(data):
|
def data_abort(data):
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
@ -67,6 +74,7 @@ def check_urls(appliance):
|
|||||||
|
|
||||||
urls = set()
|
urls = set()
|
||||||
|
|
||||||
|
if 'images' in appliance_json:
|
||||||
for image in appliance_json['images']:
|
for image in appliance_json['images']:
|
||||||
if 'direct_download_url' in image:
|
if 'direct_download_url' in image:
|
||||||
urls.add(image['direct_download_url'])
|
urls.add(image['direct_download_url'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user