Capture exceptions when release index files are not found
@@ -151,6 +151,7 @@ class ComputePlan:
url = DEV_DATA_JSON_URL
log.info("Reading {}".format(url))
+ try:
txt = urlopen(url).read().decode("utf-8")
datasets = json.loads(txt)
datafound = {}
@@ -166,11 +167,15 @@ class ComputePlan:
if "datasets" in record:
if record["datasets"] != "":
for ds in record["datasets"]:
- datafound.update(dict(parse_datafiles(ds, datasets)))
+ datafound.update(
+ dict(parse_datafiles(ds, datasets))
+ )
if not datafound:
log.info("No datasets found")
sys.exit()
self.listfiles = datafound
+ except Exception as ex:
+ log.error(ex)
return self.listfiles
@@ -182,6 +187,7 @@ class ComputePlan:
url = DEV_NBS_YAML_URL
log.info("Reading {}".format(url))
+ try:
txt = urlopen(url).read().decode("utf-8")
for nb in yaml.safe_load(txt):
@@ -200,6 +206,8 @@ class ComputePlan:
if nb["images"]:
for im in nb["images"]:
self.listfiles[label]["images"].append(im)
+ except Exception as ex:
+ log.error(ex)
def parse_scripts_yaml(self):
if self.release:
@@ -209,6 +217,7 @@ class ComputePlan:
url = DEV_SCRIPTS_YAML_URL
log.info("Reading {}".format(url))
+ try:
txt = urlopen(url).read().decode("utf-8")
for sc in yaml.safe_load(txt):
@@ -222,6 +231,8 @@ class ComputePlan:
if sc["datasets"]:
for ds in sc["datasets"]:
self.listfiles[label]["datasets"].append(ds)
+ except Exception as ex:
+ log.error(ex)
class ParallelDownload:
