1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 17:26:15 +02:00

- build.Buildinfo: improved error formatting

Use the same formatting for an "unresolvable" error as in "osc results -v"
This commit is contained in:
Marcus Huewe 2015-09-23 18:29:51 +02:00
parent d0f7c66e80
commit 070daecaf5

View File

@ -100,7 +100,12 @@ class Buildinfo:
if root.find('error') != None:
sys.stderr.write('buildinfo is broken... it says:\n')
error = root.find('error').text
sys.stderr.write(error + '\n')
if error.startswith('unresolvable: '):
sys.stderr.write('unresolvable: ')
sys.stderr.write('\n '.join(error[14:].split(',')))
else:
sys.stderr.write(error)
sys.stderr.write('\n')
sys.exit(1)
if not (apiurl.startswith('https://') or apiurl.startswith('http://')):