Skip to content

Commit

Permalink
Merge pull request #99 from salsadigitalauorg/bugfix/DEVOPS-646-wait-…
Browse files Browse the repository at this point in the history
…condition-fail

[DEVOPS-646] Fixed wait condition
  • Loading branch information
yusufhm authored Oct 22, 2024
2 parents c24c6d9 + 0ca5558 commit e2b0250
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api/plugins/action/mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def run(self, tmp=None, task_vars=None):
wait = self._task.args.get('wait', False)
waitCondition = self._task.args.get('waitCondition', {
'field': 'status',
'value': 'complete',
'value': ['complete', 'failed'],
})

with self.client:
Expand Down Expand Up @@ -69,5 +69,8 @@ def waitQuery(self, qryName, waitQry, waitCondition) -> Dict[str, Any]:

def evaluateWaitCondition(self, qryName, waitResult, waitCondition) -> bool:
if waitCondition["field"] in waitResult[qryName]:
return waitResult[qryName][waitCondition["field"]] == waitCondition["value"]
if isinstance(waitCondition["value"], list):
return waitResult[qryName][waitCondition["field"]] in waitCondition["value"]
else:
return waitResult[qryName][waitCondition["field"]] == waitCondition["value"]
return False

0 comments on commit e2b0250

Please sign in to comment.