Fixes bug 957708.

Work around bug in netaddr 0.7.5
https://github.com/drkjam/netaddr/issues/2

Change-Id: I3e064860c3865d5029481e6d63c5284d275a0081
This commit is contained in:
MotoKen
2012-03-20 13:46:38 +08:00
parent 9e3034b16c
commit 20efe8d2a7

View File

@@ -1219,6 +1219,10 @@ def is_valid_cidr(address):
netaddr.IPNetwork(address)
except netaddr.core.AddrFormatError:
return False
except UnboundLocalError:
# NOTE(MotoKen): work around bug in netaddr 0.7.5 (see detail in
# https://github.com/drkjam/netaddr/issues/2)
return False
# Prior validation partially verify /xx part
# Verify it here