Skip to content

Commit 24db4d8

Browse files
ustcweizhouyadvr
authored andcommitted
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.
1 parent 114df3d commit 24db4d8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/vm/network/security_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ def parse_network_rules(rules):
967967
ipv6 = []
968968
for ip in cidrs.split(","):
969969
try:
970-
network = ipaddress.ip_network(ip)
970+
network = ipaddress.ip_network(ip, False)
971971
if network.version == 4:
972972
ipv4.append(ip)
973973
else:

0 commit comments

Comments
 (0)