Browse code

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>

Ondra Machacek authored on 2018/10/18 20:56:36
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,2 @@
0
+bugfixes:
1
+  - ovirt_vm - Check next_run configuration update if exist (https://github.com/ansible/ansible/pull/47282/).
... ...
@@ -1146,6 +1146,13 @@ class VmsModule(BaseModule):
1146 1146
         )
1147 1147
 
1148 1148
     def update_check(self, entity):
1149
+        res = self._update_check(entity)
1150
+        if entity.next_run_configuration_exists:
1151
+            res = res and self._update_check(self._service.service(entity.id).get(next_run=True))
1152
+
1153
+        return res
1154
+
1155
+    def _update_check(self, entity):
1149 1156
         def check_cpu_pinning():
1150 1157
             if self.param('cpu_pinning'):
1151 1158
                 current = []