validation should not raises ValueError

This commit is contained in:
Emmanuel Garette 2017-09-22 20:01:07 +02:00
parent e32820c913
commit 7e281235bc
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ class BroadcastOption(Option):
def _cons_broadcast(self, current_opt, opts, vals, warnings_only):
if len(vals) != 3:
raise ConfigError(_('invalid len for vals'))
return ConfigError(_('invalid len for vals'))
if None in vals:
return
broadcast, network, netmask = vals

View File

@ -84,7 +84,7 @@ class IPOption(Option):
def _cons_in_network(self, current_opt, opts, vals, warnings_only):
if len(vals) != 3:
raise ConfigError(_('invalid len for vals'))
return ConfigError(_('invalid len for vals'))
if None in vals:
return
ip, network, netmask = vals