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