fix exception handling

This commit is contained in:
Stephan Kulow 2014-02-18 07:22:55 +01:00
parent 15800dbe27
commit 28789e0c23
2 changed files with 5 additions and 4 deletions

View File

@ -17,7 +17,7 @@ class RequestFinder:
url = makeurl(apiurl, ['request', str(request)])
try:
f = http_GET(url)
except HTTPError:
except urllib2.HTTPError:
return None
root = ET.parse(f).getroot()

View File

@ -430,13 +430,14 @@ class StagingAPI(object):
try:
f = http_GET(url)
except HTTPError:
except urllib2.HTTPError:
return 'No openQA result (yet) for {}'.format(url)
import json
openqa = json.load(f)
if openqa['overall'] != 'ok':
return "Openqa's overall status is {}".format(openqa['overall'])
overall = openqa.get('overall', 'inprogress')
if overall != 'ok':
return "Openqa's overall status is {}".format(overall)
for module in openqa['testmodules']:
# zypper_in fails at the moment - urgent fix needed