IPSet Manager: make code more pythonic
Remove unnecessary brackets. TrivialFix Change-Id: I34e29a9911be9731bc9f4b2d7f3b055e4b85a438
This commit is contained in:
parent
5fe2ab900f
commit
afb2936cf4
|
@ -46,11 +46,11 @@ class IpsetManager(object):
|
|||
sanitized_addresses = []
|
||||
for ip in addresses:
|
||||
ip = netaddr.IPNetwork(ip)
|
||||
if (ip.prefixlen == 0):
|
||||
if(ip.version == 4):
|
||||
if ip.prefixlen == 0:
|
||||
if ip.version == 4:
|
||||
sanitized_addresses.append('0.0.0.0/1')
|
||||
sanitized_addresses.append('128.0.0.0/1')
|
||||
elif (ip.version == 6):
|
||||
elif ip.version == 6:
|
||||
sanitized_addresses.append('::/1')
|
||||
sanitized_addresses.append('8000::/1')
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue