Add MasterSlaves object
This commit is contained in:
@ -5,7 +5,7 @@ do_autopath()
|
||||
from tiramisu import setting, value
|
||||
setting.expires_time = 1
|
||||
value.expires_time = 1
|
||||
from tiramisu.option import BoolOption, IPOption, IntOption, StrOption, OptionDescription
|
||||
from tiramisu.option import BoolOption, IPOption, IntOption, StrOption, OptionDescription, MasterSlaves
|
||||
from tiramisu.config import Config
|
||||
from tiramisu.error import ConfigError, PropertiesOptionError
|
||||
from tiramisu.setting import groups
|
||||
@ -349,8 +349,8 @@ def test_force_cache():
|
||||
def test_cache_master_slave():
|
||||
ip_admin_eth0 = StrOption('ip_admin_eth0', "ip réseau autorisé", multi=True)
|
||||
netmask_admin_eth0 = StrOption('netmask_admin_eth0', "masque du sous-réseau", multi=True)
|
||||
interface1 = OptionDescription('ip_admin_eth0', '', [ip_admin_eth0, netmask_admin_eth0])
|
||||
interface1.impl_set_group_type(groups.master)
|
||||
interface1 = MasterSlaves('ip_admin_eth0', '', [ip_admin_eth0, netmask_admin_eth0])
|
||||
#interface1.impl_set_group_type(groups.master)
|
||||
maconfig = OptionDescription('toto', '', [interface1])
|
||||
cfg = Config(maconfig)
|
||||
cfg.read_write()
|
||||
@ -511,8 +511,8 @@ def test_cache_callback():
|
||||
def test_cache_master_and_slaves_master():
|
||||
val1 = StrOption('val1', "", multi=True)
|
||||
val2 = StrOption('val2', "", multi=True)
|
||||
interface1 = OptionDescription('val1', '', [val1, val2])
|
||||
interface1.impl_set_group_type(groups.master)
|
||||
interface1 = MasterSlaves('val1', '', [val1, val2])
|
||||
#interface1.impl_set_group_type(groups.master)
|
||||
maconfig = OptionDescription('rootconfig', '', [interface1])
|
||||
cfg = Config(maconfig)
|
||||
cfg.cfgimpl_get_settings().remove('expire')
|
||||
@ -552,8 +552,8 @@ def test_cache_master_and_slaves_master():
|
||||
def test_cache_master_callback():
|
||||
val1 = StrOption('val1', "", multi=True)
|
||||
val2 = StrOption('val2', "", multi=True, callback=return_value, callback_params={'value': ((val1, False),)})
|
||||
interface1 = OptionDescription('val1', '', [val1, val2])
|
||||
interface1.impl_set_group_type(groups.master)
|
||||
interface1 = MasterSlaves('val1', '', [val1, val2])
|
||||
#interface1.impl_set_group_type(groups.master)
|
||||
maconfig = OptionDescription('rootconfig', '', [interface1])
|
||||
cfg = Config(maconfig)
|
||||
cfg.cfgimpl_get_settings().remove('expire')
|
||||
@ -580,8 +580,8 @@ def test_cache_master_slave_different():
|
||||
b = IntOption('int', 'Test int option', default=[0], multi=True)
|
||||
c = StrOption('str', 'Test string option', multi=True)
|
||||
d = StrOption('str1', 'Test string option', requires=[{'option': c, 'expected': None, 'action': 'hidden', 'inverse': True}], multi=True)
|
||||
descr = OptionDescription("int", "", [b, c, d])
|
||||
descr.impl_set_group_type(groups.master)
|
||||
descr = MasterSlaves("int", "", [b, c, d])
|
||||
#descr.impl_set_group_type(groups.master)
|
||||
cfg = Config(descr)
|
||||
cfg.cfgimpl_get_settings().remove('expire')
|
||||
cfg.read_write()
|
||||
|
Reference in New Issue
Block a user