ovirt_vm: Check next_run configuration update if exist

This PR fixes the update check method so it now check also the next_run
configuration of the virtual machine if it exists.

So if previously the VM was updated with new parameters, and then reset
back, the module didn't set the parameters to be set back in next_run.
This PR fixes it so the next run configuration is set back with proper
parameters.

Signed-off-by: Ondra Machacek <omachace@redhat.com>
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1639894
Signed-off-by: Ondra Machacek <omachace@redhat.com>
This commit is contained in:
Ondra Machacek 2018-10-18 13:56:36 +02:00 committed by Toshio Kuratomi
parent 702820d673
commit a9128b9fb0
2 changed files with 9 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- ovirt_vm - Check next_run configuration update if exist (https://github.com/ansible/ansible/pull/47282/).

View file

@ -1146,6 +1146,13 @@ class VmsModule(BaseModule):
)
def update_check(self, entity):
res = self._update_check(entity)
if entity.next_run_configuration_exists:
res = res and self._update_check(self._service.service(entity.id).get(next_run=True))
return res
def _update_check(self, entity):
def check_cpu_pinning():
if self.param('cpu_pinning'):
current = []