cloudstack: cs_portforward: fix rule not found if domain is not account's domain. (#3093)

cs_portforward will not find the rule and tries to create it resulting in an API error.

Thanks to @mostkopf for reporting.
pull/18777/head
René Moser 8 years ago committed by Matt Clay
parent d698a9b5f7
commit 9518290454

@ -239,6 +239,8 @@ class AnsibleCloudStackPortforwarding(AnsibleCloudStack):
args = {} args = {}
args['ipaddressid'] = self.get_ip_address(key='id') args['ipaddressid'] = self.get_ip_address(key='id')
args['account'] = self.get_account(key='name')
args['domainid'] = self.get_domain(key='id')
args['projectid'] = self.get_project(key='id') args['projectid'] = self.get_project(key='id')
portforwarding_rules = self.cs.listPortForwardingRules(**args) portforwarding_rules = self.cs.listPortForwardingRules(**args)
@ -271,6 +273,8 @@ class AnsibleCloudStackPortforwarding(AnsibleCloudStack):
args['vmguestip'] = self.get_vm_guest_ip() args['vmguestip'] = self.get_vm_guest_ip()
args['ipaddressid'] = self.get_ip_address(key='id') args['ipaddressid'] = self.get_ip_address(key='id')
args['virtualmachineid'] = self.get_vm(key='id') args['virtualmachineid'] = self.get_vm(key='id')
args['account'] = self.get_account(key='name')
args['domainid'] = self.get_domain(key='id')
portforwarding_rule = None portforwarding_rule = None
self.result['changed'] = True self.result['changed'] = True

Loading…
Cancel
Save