simplify netmaskoption
This commit is contained in:
parent
74d367c731
commit
a248e114de
|
@ -84,7 +84,7 @@ class NetmaskOption(StrOption):
|
||||||
val_netmask, val_ip = vals
|
val_netmask, val_ip = vals
|
||||||
opt_netmask, opt_ip = opts
|
opt_netmask, opt_ip = opts
|
||||||
ip = ip_interface('{0}/{1}'.format(val_ip, val_netmask))
|
ip = ip_interface('{0}/{1}'.format(val_ip, val_netmask))
|
||||||
if not _cidr and current_opt == opt_ip
|
if not _cidr and current_opt == opt_ip:
|
||||||
if ip.ip == ip.network.network_address:
|
if ip.ip == ip.network.network_address:
|
||||||
raise ValueError( _('this is a network with netmask "{0}" ("{1}")'
|
raise ValueError( _('this is a network with netmask "{0}" ("{1}")'
|
||||||
'').format(val_netmask,
|
'').format(val_netmask,
|
||||||
|
@ -100,5 +100,5 @@ class NetmaskOption(StrOption):
|
||||||
opt_ip.impl_get_display_name()))
|
opt_ip.impl_get_display_name()))
|
||||||
elif ip.ip == ip.network.broadcast_address:
|
elif ip.ip == ip.network.broadcast_address:
|
||||||
raise ValueError(_('IP "{0}" ("{1}") is the broadcast'
|
raise ValueError(_('IP "{0}" ("{1}") is the broadcast'
|
||||||
'')format(val_ip,
|
'').format(val_ip,
|
||||||
opt_ip.impl_get_display_name()))
|
opt_ip.impl_get_display_name()))
|
||||||
|
|
Loading…
Reference in New Issue