diff options
author | Göktürk Yüksek <gokturk@gentoo.org> | 2016-12-11 22:17:51 -0500 |
---|---|---|
committer | Göktürk Yüksek <gokturk@gentoo.org> | 2016-12-11 22:17:51 -0500 |
commit | 963afe1163125b8cbed08c0e8edea9a05a37510e (patch) | |
tree | e72efe43122ff06be0de9fd81e5b5bb6e3288334 | |
parent | www-apps/gentoostats: update EAPI, inherits, URI, cleanup (diff) | |
download | gentoostats-963afe1163125b8cbed08c0e8edea9a05a37510e.tar.gz gentoostats-963afe1163125b8cbed08c0e8edea9a05a37510e.tar.bz2 gentoostats-963afe1163125b8cbed08c0e8edea9a05a37510e.zip |
client/gentoostats/environment.py: fix getLastSync()
The portage.grabfile() returns an empty list when 'timestamp.chk' does
not exist, instead of None. This is normal for non-rsync syncs. Add a
check for the empty list.
-rw-r--r-- | client/gentoostats/environment.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/client/gentoostats/environment.py b/client/gentoostats/environment.py index 79313e1..913265a 100644 --- a/client/gentoostats/environment.py +++ b/client/gentoostats/environment.py @@ -37,7 +37,7 @@ class Environment(object): lastsync = portage.grabfile(os.path.join(self.portdir, 'metadata', 'timestamp.chk')) except portage.exception.PortageException: pass - if lastsync is None: + if not lastsync or lastsync is None: return 'Unknown' return lastsync[0] |