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

cloudstack: cs_securitygroup_rule: fix impossible to set icmp_code and icmp_type to 0 (#19258)

This commit is contained in:
René Moser 2016-12-13 06:58:17 +01:00 committed by GitHub
parent ef391a11ec
commit a28d898c29

View file

@ -243,10 +243,10 @@ class AnsibleCloudStackSecurityGroupRule(AnsibleCloudStack):
icmp_code = self.module.params.get('icmp_code')
icmp_type = self.module.params.get('icmp_type')
if protocol in ['tcp', 'udp'] and not (start_port and end_port):
if protocol in ['tcp', 'udp'] and (start_port is None or end_port is None):
self.module.fail_json(msg="no start_port or end_port set for protocol '%s'" % protocol)
if protocol == 'icmp' and not (icmp_type and icmp_code):
if protocol == 'icmp' and (icmp_type is None or icmp_code is None):
self.module.fail_json(msg="no icmp_type or icmp_code set for protocol '%s'" % protocol)
for rule in rules: