summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Westphahl <simon.westphahl@bmw.de>2023-02-14 11:26:20 +0100
committerSimon Westphahl <simon.westphahl@bmw.de>2023-02-14 15:08:48 +0100
commit8d443f1ada1453e9d8116f86a6ad45393887de7c (patch)
tree209f7986e0a718a942dd1c35756aba2e861cedac
parent776bbc6a6eb7f88f0c0ba5c680815cee22316a4f (diff)
downloadzuul-8d443f1ada1453e9d8116f86a6ad45393887de7c.tar.gz
Fix exception on retry in source base class
ERROR zuul.Scheduler: Exception processing pipeline check in tenant foobar Traceback (most recent call last): File "/opt/zuul/lib/python3.10/site-packages/zuul/scheduler.py", line 2149, in process_pipelines refreshed = self._process_pipeline( File "/opt/zuul/lib/python3.10/site-packages/zuul/scheduler.py", line 2241, in _process_pipeline self.process_pipeline_trigger_queue(tenant, pipeline) File "/opt/zuul/lib/python3.10/site-packages/zuul/scheduler.py", line 2447, in process_pipeline_trigger_queue self._process_trigger_event(tenant, pipeline, event) File "/opt/zuul/lib/python3.10/site-packages/zuul/scheduler.py", line 2480, in _process_trigger_event pipeline.manager.addChange(change, event) File "/opt/zuul/lib/python3.10/site-packages/zuul/manager/__init__.py", line 534, in addChange self.updateCommitDependencies(change, None, event) File "/opt/zuul/lib/python3.10/site-packages/zuul/manager/__init__.py", line 864, in updateCommitDependencies dep = source.getChangeByURLWithRetry(match, event) File "/opt/zuul/lib/python3.10/site-packages/zuul/source/__init__.py", line 112, in getChangeByURLWithRetry return dep UnboundLocalError: local variable 'dep' referenced before assignment Change-Id: I1c706e5e5d2d337ec84b8fc1ad5e900191f2362c
-rw-r--r--zuul/source/__init__.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/zuul/source/__init__.py b/zuul/source/__init__.py
index 01a683b23..c2487af88 100644
--- a/zuul/source/__init__.py
+++ b/zuul/source/__init__.py
@@ -97,7 +97,7 @@ class BaseSource(object, metaclass=abc.ABCMeta):
# info on subsequent requests we can continue to do the
# requested job work.
try:
- dep = self.getChangeByURL(url, event)
+ return self.getChangeByURL(url, event)
except Exception:
# Note that if the change isn't found dep is None.
# We do not raise in that case and do not need to handle it
@@ -109,7 +109,6 @@ class BaseSource(object, metaclass=abc.ABCMeta):
time.sleep(1)
else:
raise
- return dep
@abc.abstractmethod
def getChangesDependingOn(self, change, projects, tenant):