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

- fix display of time in jobhistory when the job builds more than one day

This commit is contained in:
Adrian Schröter 2013-02-11 11:18:27 +01:00
parent 7d46c5f879
commit d21bbe48fd

View File

@ -5301,11 +5301,14 @@ def print_jobhistory(apiurl, prj, current_package, repository, arch, format = 't
st = int(node.get('starttime')) st = int(node.get('starttime'))
et = int(node.get('endtime')) et = int(node.get('endtime'))
endtime = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(et)) endtime = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(et))
print "XXX", et, st
waittm = time.gmtime(et-st) waittm = time.gmtime(et-st)
if waittm.tm_hour: if waittm.tm_mday>1:
waitbuild = "%2dh %2dm %2ds" % (waittm.tm_hour, waittm.tm_min, waittm.tm_sec) waitbuild = "%1dd %2dh %2dm %2ds" % (waittm.tm_mday-1, waittm.tm_hour, waittm.tm_min, waittm.tm_sec)
elif waittm.tm_hour:
waitbuild = " %2dh %2dm %2ds" % (waittm.tm_hour, waittm.tm_min, waittm.tm_sec)
else: else:
waitbuild = " %2dm %2ds" % (waittm.tm_min, waittm.tm_sec) waitbuild = " %2dm %2ds" % (waittm.tm_min, waittm.tm_sec)
if format == 'csv': if format == 'csv':
print '%s|%s|%s|%s|%s|%s' % (endtime, package, reason, code, waitbuild, worker) print '%s|%s|%s|%s|%s|%s' % (endtime, package, reason, code, waitbuild, worker)