diff --git a/tiramisu/option/netmaskoption.py b/tiramisu/option/netmaskoption.py index 0e4d196..ce6e74c 100644 --- a/tiramisu/option/netmaskoption.py +++ b/tiramisu/option/netmaskoption.py @@ -54,21 +54,21 @@ class NetmaskOption(StrOption): vals, warnings_only, context): - #opts must be (netmask, network) options if context is undefined and len(vals) != 2: raise ConfigError(_('network_netmask needs a network and a netmask')) if None in vals or len(vals) != 2: return val_netmask, val_network = vals + opt_netmask, opt_network = opts try: ip_network('{0}/{1}'.format(val_network, val_netmask)) except ValueError: - if current_opt == opts[1]: + if current_opt == opt_network: raise ValueError(_('with netmask "{0}" ("{1}")').format(val_netmask, - opts[0].impl_get_display_name())) + opt_netmask.impl_get_display_name())) else: raise ValueError(_('with network "{0}" ("{1}")').format(val_network, - opts[1].impl_get_display_name())) + opt_network.impl_get_display_name())) def _cons_ip_netmask(self, current_opt,