Update "if .. if .." to "if .. in .."

Make the code structure looks more clear and more clean.

Change-Id: I5cfce411d7cc182d3ac50170b2ea6a4bc2598525
This commit is contained in:
devfu 2021-06-03 16:09:06 +08:00
parent 9773f99feb
commit c33d8d98bd
1 changed files with 3 additions and 5 deletions

View File

@ -440,15 +440,13 @@ class Job(object):
return
for job_action in self.job_doc.get('job_actions', []):
if job_action.get('mandatory', False) or\
if job_action.get('mandatory', False) or \
(result == Job.SUCCESS_RESULT):
action_result = self.execute_job_action(job_action)
if action_result == Job.FAIL_RESULT:
result = Job.FAIL_RESULT
if action_result in [Job.FAIL_RESULT, Job.ABORTED_RESULT]:
result = action_result
if action_result == Job.ABORTED_RESULT:
result = Job.ABORTED_RESULT
else:
freezer_action = job_action.get('freezer_action', {})
action_name = freezer_action.get('action', '')