diff options
author | Martin Nečas <necas.marty@gmail.com> | 2020-02-03 15:21:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-03 09:21:10 -0500 |
commit | fad261b04f569ce12a5af5e2e09d08da919c7a8a (patch) | |
tree | b2904dd7f0b73dc31614b750407a8071190b95b4 | |
parent | 53c7f8cbdee3c798a6947b834d0640935155d85b (diff) | |
download | ansible-fad261b04f569ce12a5af5e2e09d08da919c7a8a.tar.gz |
ovirt_job: add when job is detected but in state finished (#66810)
* ovirt_job: add when job is detected but in state finished
* add docs
-rw-r--r-- | lib/ansible/modules/cloud/ovirt/ovirt_job.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_job.py b/lib/ansible/modules/cloud/ovirt/ovirt_job.py index 5a96d7f965..7b6c595ee3 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_job.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_job.py @@ -36,6 +36,7 @@ options: description: description: - "Description of the job." + - "When task with same description has already finished and you rerun taks it will create new job." required: true state: description: @@ -199,7 +200,7 @@ def main(): job = get_entity(jobs_service, module.params['description']) changed = False if state in ['present', 'started']: - if job is None: + if job is None or job.status in [otypes.JobStatus.FINISHED, otypes.JobStatus.FAILED]: job = jobs_service.add(build_job(module.params['description'])) changed = True changed = attach_steps(module, job.id, jobs_service) or changed |