Commit 823653f8 authored by Guido Gunther's avatar Guido Gunther
Browse files

librem5-devkit-flash-image: Report proper error when job wasn't found

parent a1268edb
......@@ -189,7 +189,11 @@ def download_image(url, target, attempts):
def find_image(jobname, type, variant, dist):
server = jenkins.Jenkins(JENKINS)
logging.info("Looking for {} {} {} image".format(type, variant, dist))
info = server.get_job_info(jobname)
try:
info = server.get_job_info(jobname)
except jenkins.NotFoundException:
logging.error("Job %s not found", jobname)
return None
for build in info['builds']:
resp = requests.get(build['url'] + '/api/json')
resp.raise_for_status()
......@@ -207,7 +211,11 @@ def find_image(jobname, type, variant, dist):
def find_uboot(jobname):
server = jenkins.Jenkins(JENKINS)
info = server.get_job_info(jobname)
try:
info = server.get_job_info(jobname)
except jenkins.NotFoundException:
logging.error("Job %s not found", jobname)
return None
for build in info['builds']:
resp = requests.get(build['url'] + '/api/json')
resp.raise_for_status()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment