make example CIDR form address family appropriate
https://bugs.launchpad.net/bugs/1782391
This commit is contained in:
parent
7f766e93a1
commit
96ee3db409
|
@ -92,7 +92,11 @@ class NetworkConfigForm(Form):
|
||||||
def clean_subnet(self, subnet):
|
def clean_subnet(self, subnet):
|
||||||
log.debug("clean_subnet %r", subnet)
|
log.debug("clean_subnet %r", subnet)
|
||||||
if '/' not in subnet:
|
if '/' not in subnet:
|
||||||
raise ValueError(_("should be in CIDR form (xx.xx.xx.xx/yy)"))
|
if self.ip_version == 4:
|
||||||
|
example = "xx.xx.xx.xx/yy"
|
||||||
|
else:
|
||||||
|
example = "xx:xx:..:xx/yy"
|
||||||
|
raise ValueError(_("should be in CIDR form ({})").format(example))
|
||||||
return self.ip_network_cls(subnet)
|
return self.ip_network_cls(subnet)
|
||||||
|
|
||||||
def clean_address(self, address):
|
def clean_address(self, address):
|
||||||
|
|
Loading…
Reference in New Issue