mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-26 20:22:13 +01:00
fix streaming of unfinished logfiles again
This commit is contained in:
parent
db7c4c4ad5
commit
c0ac2a9207
14
osc/core.py
14
osc/core.py
@ -2717,11 +2717,19 @@ def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=Non
|
|||||||
def print_buildlog(apiurl, prj, package, platform, arch, offset = 0):
|
def print_buildlog(apiurl, prj, package, platform, arch, offset = 0):
|
||||||
"""prints out the buildlog on stdout"""
|
"""prints out the buildlog on stdout"""
|
||||||
try:
|
try:
|
||||||
u = makeurl(apiurl, ['build', prj, platform, arch, package, '_log?start=%s' % offset])
|
while True:
|
||||||
|
u = makeurl(apiurl, ['build', prj, platform, arch, package, '_log?nostream=1&start=%s' % offset])
|
||||||
f = http_GET(u)
|
f = http_GET(u)
|
||||||
for log_chunk in f:
|
start_offset = offset
|
||||||
|
while True:
|
||||||
|
log_chunk = f.read(8192)
|
||||||
offset += len(log_chunk)
|
offset += len(log_chunk)
|
||||||
print log_chunk.strip()
|
print log_chunk,
|
||||||
|
if not len(log_chunk):
|
||||||
|
break
|
||||||
|
if start_offset == offset:
|
||||||
|
break
|
||||||
|
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
print >>sys.stderr, 'Can\'t get logfile'
|
print >>sys.stderr, 'Can\'t get logfile'
|
||||||
print >>sys.stderr, e
|
print >>sys.stderr, e
|
||||||
|
Loading…
x
Reference in New Issue
Block a user