support of non multi variable

This commit is contained in:
Emmanuel Garette 2013-06-11 15:31:20 +02:00
parent 6d1cf308b2
commit b2538f6f0b

View file

@ -121,7 +121,7 @@ class Values(object):
(is_frozen and (is_frozen and
'force_default_on_freeze' in setting[opt])): 'force_default_on_freeze' in setting[opt])):
no_value_slave = False no_value_slave = False
if opt.impl_get_multitype() == multitypes.slave: if opt.impl_is_multi() and opt.impl_get_multitype() == multitypes.slave:
masterp = self.context.cfgimpl_get_description().impl_get_path_by_opt( masterp = self.context.cfgimpl_get_description().impl_get_path_by_opt(
opt.impl_get_master_slaves()) opt.impl_get_master_slaves())
mastervalue = getattr(self.context, masterp) mastervalue = getattr(self.context, masterp)
@ -132,8 +132,7 @@ class Values(object):
if not no_value_slave: if not no_value_slave:
value = self._getcallback_value(opt) value = self._getcallback_value(opt)
if opt.impl_is_multi(): if opt.impl_is_multi() and opt.impl_get_multitype() == multitypes.slave:
if opt.impl_get_multitype() == multitypes.slave:
if isinstance(value, list): if isinstance(value, list):
raise ValueError('callback must not return list ' raise ValueError('callback must not return list '
'in slave {0}: {1}'.format(opt._name, 'in slave {0}: {1}'.format(opt._name,