Checking install_time for '(none)' value

RedHat systems might in some cases return '(none)' as install_time,
which would cause a ValueError.

We are checking for '(none)' now. install_date and install_date_time
are being set to None in that case.
This commit is contained in:
Jochen Breuer 2017-08-30 10:14:38 +02:00
parent a4856372ca
commit 7aeed33575
No known key found for this signature in database
GPG Key ID: 29ACE79F4D5EEE69

View File

@ -104,7 +104,7 @@ def parse_pkginfo(line, osarch=None):
if epoch not in ('(none)', '0'):
version = ':'.join((epoch, version))
if install_time:
if install_time not in ('(none)', '0'):
install_date = datetime.datetime.utcfromtimestamp(int(install_time)).isoformat() + "Z"
install_date_time_t = int(install_time)
else: