1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 06:46:15 +01:00

- request_interactive_review: don't abort if the diff fails due to status 404

This commit is contained in:
Marcus Huewe 2010-08-27 12:44:10 +02:00
parent d5c91babc1
commit 9ac19b2c22

View File

@ -5078,10 +5078,26 @@ def request_interactive_review(apiurl, request):
diff = server_diff(apiurl, request.actions[0].dst_project, request.actions[0].dst_package, None,
request.actions[0].src_project, request.actions[0].src_package, request.actions[0].src_rev, True, True)
except urllib2.HTTPError, e:
if e.code != 400:
if e.code == 400:
try:
diff = server_diff(apiurl, request.actions[0].dst_project, request.actions[0].dst_package, None,
request.actions[0].src_project, request.actions[0].src_package, request.actions[0].src_rev, True, False)
except urllib2.HTTPError, e:
tmpfile.close()
tmpfile = None
if e.code != 404:
raise e
root = ET.fromstring(e.read())
print >>sys.stderr, root.find('summary').text
continue
elif e.code == 404:
tmpfile.close()
tmpfile = None
root = ET.fromstring(e.read())
print >>sys.stderr, root.find('summary').text
continue
else:
raise e
diff = server_diff(apiurl, request.actions[0].dst_project, request.actions[0].dst_package, None,
request.actions[0].src_project, request.actions[0].src_package, request.actions[0].src_rev, True, False)
tmpfile.write(diff)
tmpfile.flush()
run_editor(tmpfile.name)