cloudstack: cs_securitygroup_rule: type -> sg_type
This commit is contained in:
parent
8afc822d0c
commit
185cb8757d
1 changed files with 6 additions and 6 deletions
|
@ -306,15 +306,15 @@ class AnsibleCloudStackSecurityGroupRule(AnsibleCloudStack):
|
|||
|
||||
rule = None
|
||||
res = None
|
||||
type = self.module.params.get('type')
|
||||
if type == 'ingress':
|
||||
sg_type = self.module.params.get('type')
|
||||
if sg_type == 'ingress':
|
||||
rule = self._get_rule(security_group['ingressrule'])
|
||||
if not rule:
|
||||
self.result['changed'] = True
|
||||
if not self.module.check_mode:
|
||||
res = self.cs.authorizeSecurityGroupIngress(**args)
|
||||
|
||||
elif type == 'egress':
|
||||
elif sg_type == 'egress':
|
||||
rule = self._get_rule(security_group['egressrule'])
|
||||
if not rule:
|
||||
self.result['changed'] = True
|
||||
|
@ -334,15 +334,15 @@ class AnsibleCloudStackSecurityGroupRule(AnsibleCloudStack):
|
|||
security_group = self.get_security_group()
|
||||
rule = None
|
||||
res = None
|
||||
type = self.module.params.get('type')
|
||||
if type == 'ingress':
|
||||
sg_type = self.module.params.get('type')
|
||||
if sg_type == 'ingress':
|
||||
rule = self._get_rule(security_group['ingressrule'])
|
||||
if rule:
|
||||
self.result['changed'] = True
|
||||
if not self.module.check_mode:
|
||||
res = self.cs.revokeSecurityGroupIngress(id=rule['ruleid'])
|
||||
|
||||
elif type == 'egress':
|
||||
elif sg_type == 'egress':
|
||||
rule = self._get_rule(security_group['egressrule'])
|
||||
if rule:
|
||||
self.result['changed'] = True
|
||||
|
|
Loading…
Reference in a new issue