security_group.py: check cidr unstrictly to accept cidrs like 1.1.1.1/24 (#3701)

When I add a security group rule with cidr like 1.1.1.1/24, the rule is not applied on kvm hypervisor.
Ths issue does not exist in 4.13.0.0 and previous versions.
This commit is contained in:
Wei Zhou 2019-11-21 17:09:17 +01:00 committed by Rohit Yadav
parent 114df3dee0
commit 24db4d8a70

View File

@ -967,7 +967,7 @@ def parse_network_rules(rules):
ipv6 = []
for ip in cidrs.split(","):
try:
network = ipaddress.ip_network(ip)
network = ipaddress.ip_network(ip, False)
if network.version == 4:
ipv4.append(ip)
else: