1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

cloudstack: use has_changed() from utils

This commit is contained in:
Rene Moser 2016-06-09 22:41:32 +02:00 committed by Matt Clay
parent aca98e2f8e
commit 43bee0b890
6 changed files with 8 additions and 8 deletions

View file

@ -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)

View file

@ -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()

View file

@ -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)

View file

@ -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

View file

@ -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)

View file

@ -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'])