dereference problem

This commit is contained in:
Emmanuel Garette 2018-01-03 23:33:35 +01:00
parent bdbefb184a
commit 9f68d71a83
2 changed files with 7 additions and 5 deletions

View File

@ -214,9 +214,9 @@ def test_meta_meta_set():
raises(AttributeError, "api.config.find_first('i1', byvalue=10)")
raises(AttributeError, "api.config.find_first('not', byvalue=10)")
raises(AttributeError, "api.config.find_first('i6')")
#raises(ValueError, "api.value.set('od1.i6', 7, only_config=True, force_default=True)")
#raises(ValueError, "api.value.set('od1.i6', 7, only_config=True, force_default_if_same=True)")
#raises(ValueError, "api.value.set('od1.i6', 7, only_config=True, force_dont_change_value=True)")
raises(ValueError, "api.value.set('od1.i6', 7, only_config=True, force_default=True)")
raises(ValueError, "api.value.set('od1.i6', 7, only_config=True, force_default_if_same=True)")
raises(ValueError, "api.value.set('od1.i6', 7, only_config=True, force_dont_change_value=True)")
def test_not_meta():
@ -647,7 +647,7 @@ def test_meta_callback_slave():
assert api.config('cfg1').option.make_dict() == {'val1.val2': ['val2'], 'val1.val1': ['val4'], 'val1.val3': ['val4'], 'val': 'val'}
def test_meta_propreset():
def test_meta_reset():
ip_admin_eth0 = StrOption('ip_admin_eth0', "ip", multi=True)
netmask_admin_eth0 = StrOption('netmask_admin_eth0', "mask", multi=True, properties=('hidden',))
interface1 = MasterSlaves('ip_admin_eth0', '', [ip_admin_eth0, netmask_admin_eth0])

View File

@ -1024,7 +1024,9 @@ class GroupConfig(_CommonConfig):
value,
nconfig_bag,
_commit=False)
except (PropertiesOptionError, ValueError, SlaveError) as err:
except PropertiesOptionError as err:
ret.append(PropertiesOptionError(str(err), err.proptype))
except (ValueError, SlaveError) as err:
ret.append(err)
if _commit:
self.cfgimpl_get_values()._p_.commit()