Skip to content

Commit

Permalink
ovirt_vm: Check next_run configuration update if exist (#47280)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
machacekondra authored and ansibot committed Oct 18, 2018
1 parent 8a671f5 commit 03bccdd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/ansible/modules/cloud/ovirt/ovirt_vm.py
Expand Up @@ -1160,6 +1160,13 @@ def build_entity(self):
)

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 = []
Expand Down Expand Up @@ -1206,7 +1213,7 @@ def check_host():
equal(self.param('smartcard_enabled'), getattr(vm_display, 'smartcard_enabled', False)) and
equal(self.param('io_threads'), entity.io.threads) and
equal(self.param('ballooning_enabled'), entity.memory_policy.ballooning) and
equal(self.param('serial_console'), entity.console.enabled) and
equal(self.param('serial_console'), getattr(entity.console, 'enabled', None)) and
equal(self._get_minor(self.param('custom_compatibility_version')), self._get_minor(entity.custom_compatibility_version)) and
equal(self._get_major(self.param('custom_compatibility_version')), self._get_major(entity.custom_compatibility_version)) and
equal(self.param('usb_support'), entity.usb.enabled) and
Expand Down

0 comments on commit 03bccdd

Please sign in to comment.