From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B38381395E2 for ; Mon, 12 Dec 2016 03:22:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0182621C17C; Mon, 12 Dec 2016 03:22:12 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D245E21C17C for ; Mon, 12 Dec 2016 03:22:11 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B4B0833BE19 for ; Mon, 12 Dec 2016 03:22:10 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 23C44C78 for ; Mon, 12 Dec 2016 03:22:09 +0000 (UTC) From: "Göktürk Yüksek" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Göktürk Yüksek" Message-ID: <1481512671.963afe1163125b8cbed08c0e8edea9a05a37510e.gokturk@gentoo> Subject: [gentoo-commits] proj/gentoostats:master commit in: client/gentoostats/ X-VCS-Repository: proj/gentoostats X-VCS-Files: client/gentoostats/environment.py X-VCS-Directories: client/gentoostats/ X-VCS-Committer: gokturk X-VCS-Committer-Name: Göktürk Yüksek X-VCS-Revision: 963afe1163125b8cbed08c0e8edea9a05a37510e X-VCS-Branch: master Date: Mon, 12 Dec 2016 03:22:09 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 693fe29f-ca5c-4d48-bd4b-ea661f0cd77d X-Archives-Hash: 0faf1f6d8a49ea19427755b0b503f96b commit: 963afe1163125b8cbed08c0e8edea9a05a37510e Author: Göktürk Yüksek gentoo org> AuthorDate: Mon Dec 12 03:17:51 2016 +0000 Commit: Göktürk Yüksek gentoo org> CommitDate: Mon Dec 12 03:17:51 2016 +0000 URL: https://gitweb.gentoo.org/proj/gentoostats.git/commit/?id=963afe11 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. client/gentoostats/environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]