Skip to content

Commit

Permalink
- fix display of time in jobhistory when the job builds more than one…
Browse files Browse the repository at this point in the history
… day
  • Loading branch information
adrianschroeter committed Feb 11, 2013
1 parent 7d46c5f commit d21bbe4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions osc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5301,11 +5301,14 @@ def print_jobhistory(apiurl, prj, current_package, repository, arch, format = 't
st = int(node.get('starttime'))
et = int(node.get('endtime'))
endtime = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(et))
print "XXX", et, st
waittm = time.gmtime(et-st)
if waittm.tm_hour:
waitbuild = "%2dh %2dm %2ds" % (waittm.tm_hour, waittm.tm_min, waittm.tm_sec)
if waittm.tm_mday>1:
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:
waitbuild = " %2dm %2ds" % (waittm.tm_min, waittm.tm_sec)
waitbuild = " %2dm %2ds" % (waittm.tm_min, waittm.tm_sec)

if format == 'csv':
print '%s|%s|%s|%s|%s|%s' % (endtime, package, reason, code, waitbuild, worker)
Expand Down

0 comments on commit d21bbe4

Please sign in to comment.