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 D5B0E139085 for ; Tue, 20 Dec 2016 22:13:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4AAA9E0D2C; Tue, 20 Dec 2016 22:13:50 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 288F0E0D2C for ; Tue, 20 Dec 2016 22:13:50 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 2DD1733BEFC for ; Tue, 20 Dec 2016 22:13:49 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BAA7A24E1 for ; Tue, 20 Dec 2016 22:13:47 +0000 (UTC) From: "Magnus Granberg" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Magnus Granberg" Message-ID: <1482271997.966f66269f41f46f29895f7c9b6240f7babd5094.zorry@gentoo> Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: pym/tbc/ X-VCS-Repository: proj/tinderbox-cluster X-VCS-Files: pym/tbc/sqlquerys.py pym/tbc/sync.py pym/tbc/updatedb.py X-VCS-Directories: pym/tbc/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: 966f66269f41f46f29895f7c9b6240f7babd5094 X-VCS-Branch: master Date: Tue, 20 Dec 2016 22:13:47 +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: 445feebf-3992-418e-a210-a6000fcc33e0 X-Archives-Hash: 4886dadf8e0c1356a516e92fca023aab commit: 966f66269f41f46f29895f7c9b6240f7babd5094 Author: Magnus Granberg gentoo org> AuthorDate: Tue Dec 20 22:13:17 2016 +0000 Commit: Magnus Granberg gentoo org> CommitDate: Tue Dec 20 22:13:17 2016 +0000 URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=966f6626 fix a NoResultFound in get_job_status_waiting_on_guest pym/tbc/sqlquerys.py | 5 +++-- pym/tbc/sync.py | 4 +++- pym/tbc/updatedb.py | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pym/tbc/sqlquerys.py b/pym/tbc/sqlquerys.py index 0276131..0ec5fc9 100644 --- a/pym/tbc/sqlquerys.py +++ b/pym/tbc/sqlquerys.py @@ -45,8 +45,9 @@ def get_jobs(session, config_id): return JobsInfo def get_job_status_waiting_on_guest(session): - JobsInfo = session.query(Jobs).filter_by(Status = 'Waiting_on_guest').one() - if JobsInfo == []: + try: + JobsInfo = session.query(Jobs).filter_by(Status = 'Waiting_on_guest').one() + except NoResultFound as e: return None return JobInfo.JobId diff --git a/pym/tbc/sync.py b/pym/tbc/sync.py index dee13ff..a93b84f 100644 --- a/pym/tbc/sync.py +++ b/pym/tbc/sync.py @@ -66,7 +66,9 @@ def git_sync_main(session): time.sleep(60) job_id = get_job_status_waiting_on_guest(session) - update_job_list(session, 'Runing', job_id) + if not job_id is None: + update_job_list(session, 'Runing', job_id) + # check git diffs witch get updated and pass that to a dict # fetch and merge the repo repo_cp_dict = {} diff --git a/pym/tbc/updatedb.py b/pym/tbc/updatedb.py index b6539e4..7fce867 100644 --- a/pym/tbc/updatedb.py +++ b/pym/tbc/updatedb.py @@ -94,7 +94,9 @@ def update_cpv_db(session, repo_cp_dict, config_id, tbc_settings): time.sleep(30) job_id = get_job_status_waiting_on_guest(session) - update_job_list(session, 'Runing', job_id) + if not job_id is None: + update_job_list(session, 'Runing', job_id) + log_msg = "Checking categories, package, ebuilds" write_log(session, log_msg, "info", config_id, 'updatedb.update_cpv_db') new_build_jobs_list = []