From 372f6e41ffffdb47f7c69f5787e23eab8ccaa26b Mon Sep 17 00:00:00 2001 From: Samori Gorse Date: Sun, 5 Jan 2025 16:58:01 +0100 Subject: [PATCH] feat: Include feedback --- plugins/modules/xen_orchestra_instance.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/modules/xen_orchestra_instance.py b/plugins/modules/xen_orchestra_instance.py index 0ed679b890..b0dea92a04 100644 --- a/plugins/modules/xen_orchestra_instance.py +++ b/plugins/modules/xen_orchestra_instance.py @@ -48,7 +48,7 @@ options: vm_uid: description: - UID of the target Virtual Machine. Required when O(state=absent), O(state=started), O(state=stopped) or - O(state=restarted) + O(state=restarted). type: str label: description: Label of the Virtual Machine to create, can be used when O(state=present). @@ -59,7 +59,7 @@ options: template: description: - UID of a template to create Virtual Machine from. - - Muse be provided when O(state=present) + - Muse be provided when O(state=present). type: str boot_after_create: description: Boot Virtual Machine after creation, can be used when O(state=present). @@ -172,9 +172,9 @@ class XenOrchestra(object): def call(self, method, params): '''Calls a method on the XO server with the provided parameters.''' - id = self.pointer + pointer = self.pointer self.conn.send(json.dumps({ - 'id': id, + 'id': pointer, 'jsonrpc': '2.0', 'method': method, 'params': params @@ -183,7 +183,7 @@ class XenOrchestra(object): waited = 0 while waited < self.CALL_TIMEOUT: response = json.loads(self.conn.recv()) - if 'id' in response and response['id'] == id: + if response.get('id') == pointer: return response else: sleep(0.1) @@ -319,7 +319,7 @@ def main(): if state == 'present': result = xen_orchestra.create_vm() - module.exit_json(changed=True, vm_uid=result) + module.exit_json(changed=False, vm_uid=result) if __name__ == '__main__':