Do Change ID query in ReviewChangeAction only if executed
Regardless, of whether the ReviewChangeAction was executed, a change ID
was queried.
Now the query will only be executed, if the action is meant to be
executed.
Change-Id: Iba59f2f9da4771c9df3a6bb2ff82dcf54e6a4083
diff --git a/container/tools/actions/review_change.py b/container/tools/actions/review_change.py
index bf88253..1e20e78 100644
--- a/container/tools/actions/review_change.py
+++ b/container/tools/actions/review_change.py
@@ -24,10 +24,11 @@
class ReviewChangeAction(abstract.AbstractAction):
def __init__(self, url, user, pwd, probability=1):
super().__init__(url, user, pwd, probability)
- self.change_id = self._get_change_id()
+ self.change_id = None
self.revision_id = 1
def _execute_action(self):
+ self.change_id = self._get_change_id()
rest_url = self._assemble_review_url()
requests.post(rest_url, auth=(self.user, self.pwd), json=self._assemble_body())
self.was_executed = True