Index: pending_manager.py |
diff --git a/pending_manager.py b/pending_manager.py |
index 7548be2e2490eae993d80d98a51ed6c49a320d50..2ccdab67836892d3cc6ab7e7bd14b416c8f663af 100644 |
--- a/pending_manager.py |
+++ b/pending_manager.py |
@@ -23,10 +23,10 @@ import traceback |
import urllib2 |
import find_depot_tools # pylint: disable=W0611 |
-import checkout |
-import git_cl |
-import patch |
-import subprocess2 |
+import checkout # pylint: disable=F0401 |
+import git_cl # pylint: disable=F0401 |
+import patch # pylint: disable=F0401 |
+import subprocess2 # pylint: disable=F0401 |
import errors |
import model |
@@ -148,14 +148,18 @@ class PendingManager(object): |
# Delay (secs) between commit bursts. |
COMMIT_BURST_DELAY = 10*60 |
- def __init__(self, context_obj, pre_patch_verifiers, verifiers): |
+ def __init__(self, context_obj, pre_patch_verifiers, verifiers, |
+ project_name=''): |
""" |
Args: |
pre_patch_verifiers: Verifiers objects that are run before applying the |
patch. |
verifiers: Verifiers object run after applying the patch. |
""" |
- assert len(pre_patch_verifiers) or len(verifiers) |
+ if not(len(pre_patch_verifiers) or len(verifiers)): |
+ raise ValueError('at least one verifier should be defined (in project %s)' |
+ % project_name) |
+ |
self.context = context_obj |
self.pre_patch_verifiers = pre_patch_verifiers or [] |
self.verifiers = verifiers or [] |
@@ -429,6 +433,7 @@ class PendingManager(object): |
'Failed to set the flag to False for %s with message %s' % ( |
pending.pending_name(), message)) |
traceback.print_stack() |
+ logging.error(str(e)) |
errors.send_stack(e) |
if message: |
try: |