From 07de65e812bab2951d96399fb3fb8660c10f31d1 Mon Sep 17 00:00:00 2001 From: Don Garrett Date: Wed, 4 Nov 2015 12:47:03 -0800 Subject: CommitQueueSyncStage: Fix --debug run case. When run with --debug and no CIDB credentials, the master-paladin config would fail by using a db connection of None. Work around that. BUG=None TEST=bin/cbuildbot --buildroot ~/tmp/build_master --debug --buildbot --branch master --buildnumber 37 master-paladin Change-Id: I9f4e1ef2157124c268252b1c8e5fc59f85049826 Reviewed-on: https://chromium-review.googlesource.com/310874 Commit-Ready: Don Garrett Tested-by: Don Garrett Reviewed-by: Paul Hobbs Reviewed-by: Aviv Keshet --- cbuildbot/stages/sync_stages.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'cbuildbot/stages') diff --git a/cbuildbot/stages/sync_stages.py b/cbuildbot/stages/sync_stages.py index dc2df54d3..0f9015e51 100644 --- a/cbuildbot/stages/sync_stages.py +++ b/cbuildbot/stages/sync_stages.py @@ -917,11 +917,14 @@ class CommitQueueSyncStage(MasterSlaveLKGMSyncStage): changes_to_test = [] _, db = self._run.GetCIDBHandle() - actions_for_changes = db.GetActionsForChanges(changes) - for change in changes: - status = clactions.GetCLPreCQStatus(change, actions_for_changes) - if status == constants.CL_STATUS_PASSED: - changes_to_test.append(change) + if db: + actions_for_changes = db.GetActionsForChanges(changes) + for change in changes: + status = clactions.GetCLPreCQStatus(change, actions_for_changes) + if status == constants.CL_STATUS_PASSED: + changes_to_test.append(change) + else: + logging.warning("DB not available, unable to filter for PreCQ passed.") # Allow Commit-Ready=+2 changes to bypass the Pre-CQ, if there are no other # changes. -- cgit v1.2.3