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

when -d (global, for debug) was used, save the body because it can't be read twice

This commit is contained in:
Dr. Peter Poeml 2008-06-03 12:31:41 +00:00
parent f8daea6288
commit 65e4d5bdd1

View File

@ -75,13 +75,15 @@ def run(prg):
if hasattr(e, 'osc_msg'):
print >>sys.stderr, e.osc_msg
body = None
if getattr(prg.options, 'debug', None) or \
getattr(prg.conf, 'config', {}).get('debug', None):
print >>sys.stderr, e.hdrs
print >>sys.stderr, e.read()
body = e.read()
print >>sys.stderr, body
if e.code == 400:
msg = e.read()
msg = body or e.read()
msg = msg.split('<summary>')[1]
msg = msg.split('</summary>')[0]
print >>sys.stderr, msg