From 48b999244616204b800161dd3b775b9bf2a26081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Moser?= Date: Wed, 26 Sep 2018 09:05:07 +0200 Subject: [PATCH] cs_ip_address: use query_api, fixes error handling (#46034) --- lib/ansible/modules/cloud/cloudstack/cs_ip_address.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/cloud/cloudstack/cs_ip_address.py b/lib/ansible/modules/cloud/cloudstack/cs_ip_address.py index 398fd83050..678d488cbf 100644 --- a/lib/ansible/modules/cloud/cloudstack/cs_ip_address.py +++ b/lib/ansible/modules/cloud/cloudstack/cs_ip_address.py @@ -166,7 +166,7 @@ class AnsibleCloudStackIPAddress(AnsibleCloudStack): 'projectid': self.get_project(key='id'), 'vpcid': self.get_vpc(key='id'), } - ip_addresses = self.cs.listPublicIpAddresses(**args) + ip_addresses = self.query_api('listPublicIpAddresses', **args) if ip_addresses: tags = self.module.params.get('tags') @@ -201,7 +201,7 @@ class AnsibleCloudStackIPAddress(AnsibleCloudStack): } ip_address = None if not self.module.check_mode: - res = self.cs.associateIpAddress(**args) + res = self.query_api('associateIpAddress', **args) poll_async = self.module.params.get('poll_async') if poll_async: @@ -220,7 +220,7 @@ class AnsibleCloudStackIPAddress(AnsibleCloudStack): self.module.params['tags'] = [] ip_address = self.ensure_tags(resource=ip_address, resource_type='publicipaddress') - res = self.cs.disassociateIpAddress(id=ip_address['id']) + res = self.query_api('disassociateIpAddress', id=ip_address['id']) poll_async = self.module.params.get('poll_async') if poll_async: