cloudstack: use has_changed() from utils

pull/18777/head
Rene Moser 9 years ago committed by Matt Clay
parent aca98e2f8e
commit 43bee0b890

@ -201,7 +201,7 @@ class AnsibleCloudStackDomain(AnsibleCloudStack):
args['id'] = domain['id']
args['networkdomain'] = self.module.params.get('network_domain')
if self._has_changed(args, domain):
if self.has_changed(args, domain):
self.result['changed'] = True
if not self.module.check_mode:
res = self.cs.updateDomain(**args)

@ -677,7 +677,7 @@ class AnsibleCloudStackInstance(AnsibleCloudStack):
args_service_offering['id'] = instance['id']
if self.module.params.get('service_offering'):
args_service_offering['serviceofferingid'] = self.get_service_offering_id()
service_offering_changed = self._has_changed(args_service_offering, instance)
service_offering_changed = self.has_changed(args_service_offering, instance)
# Instance data
args_instance_update = {}
@ -688,7 +688,7 @@ class AnsibleCloudStackInstance(AnsibleCloudStack):
args_instance_update['group'] = self.module.params.get('group')
if self.module.params.get('display_name'):
args_instance_update['displayname'] = self.module.params.get('display_name')
instance_changed = self._has_changed(args_instance_update, instance)
instance_changed = self.has_changed(args_instance_update, instance)
# SSH key data
args_ssh_key = {}
@ -696,7 +696,7 @@ class AnsibleCloudStackInstance(AnsibleCloudStack):
args_ssh_key['projectid'] = self.get_project(key='id')
if self.module.params.get('ssh_key'):
args_ssh_key['keypair'] = self.module.params.get('ssh_key')
ssh_key_changed = self._has_changed(args_ssh_key, instance)
ssh_key_changed = self.has_changed(args_ssh_key, instance)
security_groups_changed = self.security_groups_has_changed()

@ -422,7 +422,7 @@ class AnsibleCloudStackNetwork(AnsibleCloudStack):
args = self._get_args()
args['id'] = network['id']
if self._has_changed(args, network):
if self.has_changed(args, network):
self.result['changed'] = True
if not self.module.check_mode:
network = self.cs.updateNetwork(**args)

@ -320,7 +320,7 @@ class AnsibleCloudStackPortforwarding(AnsibleCloudStack):
args['ipaddressid'] = self.get_ip_address(key='id')
args['virtualmachineid'] = self.get_vm(key='id')
if self._has_changed(args, portforwarding_rule):
if self.has_changed(args, portforwarding_rule):
self.result['changed'] = True
if not self.module.check_mode:
# API broken in 4.2.1?, workaround using remove/create instead of update

@ -183,7 +183,7 @@ class AnsibleCloudStackProject(AnsibleCloudStack):
args['id'] = project['id']
args['displaytext'] = self.get_or_fallback('display_text', 'name')
if self._has_changed(args, project):
if self.has_changed(args, project):
self.result['changed'] = True
if not self.module.check_mode:
project = self.cs.updateProject(**args)

@ -217,7 +217,7 @@ class AnsibleCloudStackStaticNat(AnsibleCloudStack):
# make an alias, so we can use _has_changed()
ip_address['vmguestip'] = ip_address['vmipaddress']
if self._has_changed(args, ip_address):
if self.has_changed(args, ip_address):
self.result['changed'] = True
if not self.module.check_mode:
res = self.cs.disableStaticNat(ipaddressid=ip_address['id'])

Loading…
Cancel
Save