IPSet Manager: make code more pythonic

Remove unnecessary brackets.

TrivialFix

Change-Id: I34e29a9911be9731bc9f4b2d7f3b055e4b85a438
This commit is contained in:
Gary Kotton 2015-11-01 04:29:13 -08:00
parent 5fe2ab900f
commit afb2936cf4
1 changed files with 3 additions and 3 deletions

View File

@ -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: