PR#1691: human-readable timestamp in koji-gc log

Merges #1691
https://pagure.io/koji/pull-request/1691

Fixes: #1690
https://pagure.io/koji/issue/1690
koji-gc message about "last used" is just timestamp
This commit is contained in:
Tomas Kopecek 2019-11-26 15:14:58 +01:00
commit a84a338d73

View file

@ -15,6 +15,7 @@ except ImportError: # pragma: no cover
import koji
from koji.util import LazyDict, LazyValue, to_list
import koji.policy
import datetime
import fnmatch
import optparse
import os
@ -473,7 +474,7 @@ def handle_trash():
#XXX - should really check time server side
if options.debug:
print("[%i/%i] Build has been used in a buildroot: %s" % (i, N, nvr))
print("Last_used: %r" % ts)
print("Last_used: %s" % datetime.datetime.fromtimestamp(ts).isoformat())
age = time.time() - ts
if age < min_age:
continue