2015-07-26 18:55:21 +02:00
|
|
|
# coding: utf-8
|
2015-07-24 17:54:10 +02:00
|
|
|
from autopath import do_autopath
|
|
|
|
do_autopath()
|
2013-04-16 22:44:16 +02:00
|
|
|
|
2015-07-26 18:55:21 +02:00
|
|
|
from py.test import raises
|
2014-03-09 20:06:44 +01:00
|
|
|
from tiramisu.config import Config
|
2015-10-29 09:03:13 +01:00
|
|
|
from tiramisu.option import IntOption, StrOption, UnicodeOption, OptionDescription, SymLinkOption
|
|
|
|
from tiramisu.error import PropertiesOptionError, ConfigError
|
2015-07-26 18:55:21 +02:00
|
|
|
from tiramisu.setting import groups
|
2016-03-29 09:31:00 +02:00
|
|
|
from tiramisu.storage import delete_session
|
2013-04-16 22:44:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
def make_description():
|
|
|
|
stroption = StrOption('str', 'Test string option', default="abc",
|
|
|
|
properties=('mandatory', ))
|
|
|
|
stroption1 = StrOption('str1', 'Test string option',
|
|
|
|
properties=('mandatory', ))
|
2013-04-17 22:06:10 +02:00
|
|
|
stroption2 = UnicodeOption('unicode2', 'Test string option',
|
2013-04-20 11:25:14 +02:00
|
|
|
properties=('mandatory', ))
|
2013-04-16 22:44:16 +02:00
|
|
|
stroption3 = StrOption('str3', 'Test string option', multi=True,
|
|
|
|
properties=('mandatory', ))
|
2015-04-20 14:49:43 +02:00
|
|
|
stroption4 = StrOption('str4', 'Test string option', multi=True,
|
|
|
|
properties=('mandatory', ), allow_empty_list=True)
|
|
|
|
descr = OptionDescription('tiram', '', [stroption, stroption1, stroption2, stroption3, stroption4])
|
2013-04-16 22:44:16 +02:00
|
|
|
return descr
|
|
|
|
|
|
|
|
|
2015-10-29 09:03:13 +01:00
|
|
|
def return_value(value):
|
|
|
|
return value
|
|
|
|
|
|
|
|
|
|
|
|
def make_description2():
|
|
|
|
stroption = StrOption('str', 'Test string option', default="abc",
|
|
|
|
properties=('mandatory', ))
|
|
|
|
stroption1 = StrOption('str1', 'Test string option',
|
|
|
|
properties=('mandatory', ))
|
|
|
|
stroption2 = SymLinkOption('unicode2', stroption1)
|
|
|
|
stroption3 = StrOption('str3', 'Test string option', multi=True,
|
|
|
|
properties=('mandatory', ))
|
|
|
|
unicode1 = UnicodeOption('unicode1', 'Test string option', callback=return_value, callback_params={'': ((stroption, False),)}, properties=('mandatory', ))
|
|
|
|
descr = OptionDescription('tiram', '', [stroption, stroption1, stroption2, stroption3, unicode1])
|
|
|
|
return descr
|
|
|
|
|
|
|
|
|
|
|
|
def make_description_sym():
|
|
|
|
stroption = StrOption('str', 'Test string option', default="abc",
|
|
|
|
properties=('mandatory', ))
|
|
|
|
stroption1 = StrOption('str1', 'Test string option',
|
|
|
|
properties=('mandatory', ))
|
|
|
|
stroption2 = SymLinkOption('unicode2', stroption1)
|
|
|
|
stroption3 = StrOption('str3', 'Test string option', multi=True,
|
|
|
|
properties=('mandatory', ))
|
|
|
|
descr = OptionDescription('tiram', '', [stroption, stroption1, stroption2, stroption3])
|
|
|
|
return descr
|
|
|
|
|
|
|
|
|
|
|
|
def make_description3():
|
|
|
|
stroption = StrOption('str', 'Test string option', default="abc",
|
|
|
|
properties=('mandatory', ))
|
|
|
|
stroption1 = StrOption('str1', 'Test string option',
|
|
|
|
properties=('mandatory', ))
|
|
|
|
stroption2 = SymLinkOption('unicode2', stroption1)
|
|
|
|
stroption3 = StrOption('str3', 'Test string option', multi=True,
|
|
|
|
properties=('mandatory', ))
|
|
|
|
unicode1 = UnicodeOption('unicode1', 'Test string option', callback=return_value, callback_params={'': ((stroption, False),)}, properties=('mandatory', ))
|
|
|
|
int1 = IntOption('int1', '', callback=return_value, callback_params={'': ((stroption, False),)}, properties=('mandatory', ))
|
|
|
|
descr = OptionDescription('tiram', '', [stroption, stroption1, stroption2, stroption3, unicode1, int1])
|
|
|
|
return descr
|
|
|
|
|
|
|
|
|
|
|
|
def make_description4():
|
|
|
|
stroption = StrOption('str', 'Test string option', default="abc",
|
|
|
|
properties=('mandatory', ))
|
|
|
|
stroption1 = StrOption('str1', 'Test string option',
|
|
|
|
properties=('mandatory', ))
|
|
|
|
stroption2 = UnicodeOption('unicode2', 'Test string option',
|
|
|
|
properties=('mandatory', ))
|
|
|
|
stroption3 = StrOption('str3', 'Test string option', multi=True, requires=[{'option': stroption, 'expected': 'yes', 'action': 'mandatory', 'transitive': False}])
|
|
|
|
descr = OptionDescription('tiram', '', [stroption, stroption1, stroption2, stroption3])
|
|
|
|
return descr
|
|
|
|
|
|
|
|
|
2013-04-16 22:44:16 +02:00
|
|
|
def test_mandatory_ro():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man001')
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_only()
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = []
|
|
|
|
try:
|
|
|
|
config.str1
|
2013-08-28 11:33:43 +02:00
|
|
|
except PropertiesOptionError as err:
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = err.proptype
|
|
|
|
assert 'mandatory' in prop
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_write()
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str1 = 'yes'
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_only()
|
2013-04-16 22:44:16 +02:00
|
|
|
assert config.str1 == 'yes'
|
2016-09-30 22:45:33 +02:00
|
|
|
try:
|
|
|
|
delete_session('config', config.impl_getsessionid())
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2013-04-16 22:44:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_mandatory_rw():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man002')
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_write()
|
2013-04-16 22:44:16 +02:00
|
|
|
#not mandatory in rw
|
2013-04-17 22:06:10 +02:00
|
|
|
config.str1
|
|
|
|
config.str1 = 'yes'
|
|
|
|
assert config.str1 == 'yes'
|
2016-09-30 22:45:33 +02:00
|
|
|
try:
|
|
|
|
delete_session('config', config.impl_getsessionid())
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2013-04-16 22:44:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_mandatory_default():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man003')
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_only()
|
2013-04-16 22:44:16 +02:00
|
|
|
#not mandatory in rw
|
|
|
|
config.str
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_write()
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str = 'yes'
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_only()
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_write()
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str = None
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_only()
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = []
|
|
|
|
try:
|
|
|
|
config.str
|
2013-08-28 11:33:43 +02:00
|
|
|
except PropertiesOptionError as err:
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = err.proptype
|
|
|
|
assert 'mandatory' in prop
|
2016-09-30 22:45:33 +02:00
|
|
|
try:
|
|
|
|
delete_session('config', config.impl_getsessionid())
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2013-04-16 22:44:16 +02:00
|
|
|
|
|
|
|
|
2015-12-17 22:41:57 +01:00
|
|
|
def test_mandatory_delete():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man004')
|
2015-12-17 22:41:57 +01:00
|
|
|
config.read_only()
|
|
|
|
config.str
|
|
|
|
try:
|
|
|
|
config.str1
|
|
|
|
except PropertiesOptionError as err:
|
|
|
|
prop = err.proptype
|
|
|
|
assert 'mandatory' in prop
|
|
|
|
config.read_write()
|
|
|
|
config.str1 = 'yes'
|
|
|
|
config.read_only()
|
|
|
|
assert config.str1 == 'yes'
|
|
|
|
config.cfgimpl_get_settings().remove('frozen')
|
|
|
|
prop = []
|
|
|
|
try:
|
|
|
|
del(config.str1)
|
|
|
|
except PropertiesOptionError as err:
|
|
|
|
prop = err.proptype
|
|
|
|
assert 'mandatory' in prop
|
|
|
|
del(config.str)
|
|
|
|
assert config.str1 == 'yes'
|
2016-09-30 22:45:33 +02:00
|
|
|
try:
|
|
|
|
delete_session('config', config.impl_getsessionid())
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2015-12-17 22:41:57 +01:00
|
|
|
|
|
|
|
|
2013-04-16 22:44:16 +02:00
|
|
|
#valeur vide : None, '', u'', ...
|
|
|
|
def test_mandatory_none():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man005')
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str1 = None
|
2013-08-24 22:32:54 +02:00
|
|
|
assert config.getowner(config.unwrap_from_path('str1')) == 'user'
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_only()
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = []
|
|
|
|
try:
|
|
|
|
config.str1
|
2013-08-28 11:33:43 +02:00
|
|
|
except PropertiesOptionError as err:
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = err.proptype
|
|
|
|
assert 'mandatory' in prop
|
2016-09-30 22:45:33 +02:00
|
|
|
try:
|
|
|
|
delete_session('config', config.impl_getsessionid())
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2013-04-16 22:44:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_mandatory_empty():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man006')
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str1 = ''
|
2013-08-24 22:32:54 +02:00
|
|
|
assert config.getowner(config.unwrap_from_path('str1')) == 'user'
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_only()
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = []
|
|
|
|
try:
|
|
|
|
config.str1
|
2013-08-28 11:33:43 +02:00
|
|
|
except PropertiesOptionError as err:
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = err.proptype
|
|
|
|
assert 'mandatory' in prop
|
2016-09-30 22:45:33 +02:00
|
|
|
try:
|
|
|
|
delete_session('config', config.impl_getsessionid())
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2013-04-16 22:44:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_mandatory_multi_none():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man007')
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str3 = [None]
|
2013-08-24 22:32:54 +02:00
|
|
|
assert config.getowner(config.unwrap_from_path('str3')) == 'user'
|
2014-03-29 20:31:56 +01:00
|
|
|
config.read_only()
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = []
|
|
|
|
try:
|
|
|
|
config.str3
|
2013-08-28 11:33:43 +02:00
|
|
|
except PropertiesOptionError as err:
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = err.proptype
|
|
|
|
assert 'mandatory' in prop
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_write()
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str3 = ['yes', None]
|
2013-08-24 22:32:54 +02:00
|
|
|
assert config.getowner(config.unwrap_from_path('str3')) == 'user'
|
2014-03-29 20:31:56 +01:00
|
|
|
config.read_only()
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = []
|
|
|
|
try:
|
|
|
|
config.str3
|
2013-08-28 11:33:43 +02:00
|
|
|
except PropertiesOptionError as err:
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = err.proptype
|
|
|
|
assert 'mandatory' in prop
|
2016-09-30 22:45:33 +02:00
|
|
|
try:
|
|
|
|
delete_session('config', config.impl_getsessionid())
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2013-04-16 22:44:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_mandatory_multi_empty():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man008')
|
2015-04-20 14:49:43 +02:00
|
|
|
config.str3 = []
|
|
|
|
assert config.getowner(config.unwrap_from_path('str3')) == 'user'
|
|
|
|
config.read_only()
|
|
|
|
prop = []
|
|
|
|
try:
|
|
|
|
config.str3
|
|
|
|
except PropertiesOptionError as err:
|
|
|
|
prop = err.proptype
|
|
|
|
assert 'mandatory' in prop
|
|
|
|
#
|
|
|
|
config.read_write()
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str3 = ['']
|
2013-08-24 22:32:54 +02:00
|
|
|
assert config.getowner(config.unwrap_from_path('str3')) == 'user'
|
2014-03-29 20:31:56 +01:00
|
|
|
config.read_only()
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = []
|
|
|
|
try:
|
|
|
|
config.str3
|
2013-08-28 11:33:43 +02:00
|
|
|
except PropertiesOptionError as err:
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = err.proptype
|
|
|
|
assert 'mandatory' in prop
|
2015-04-20 14:49:43 +02:00
|
|
|
#
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_write()
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str3 = ['yes', '']
|
2013-08-24 22:32:54 +02:00
|
|
|
assert config.getowner(config.unwrap_from_path('str3')) == 'user'
|
2014-03-29 20:31:56 +01:00
|
|
|
config.read_only()
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = []
|
|
|
|
try:
|
|
|
|
config.str3
|
2013-08-28 11:33:43 +02:00
|
|
|
except PropertiesOptionError as err:
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = err.proptype
|
2015-04-20 14:49:43 +02:00
|
|
|
assert 'mandatory' in prop
|
2016-09-30 22:45:33 +02:00
|
|
|
try:
|
|
|
|
delete_session('config', config.impl_getsessionid())
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2015-04-20 14:49:43 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_mandatory_multi_empty_allow_empty_list():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man009')
|
2015-04-20 14:49:43 +02:00
|
|
|
config.str4 = []
|
|
|
|
assert config.getowner(config.unwrap_from_path('str4')) == 'user'
|
|
|
|
config.read_only()
|
|
|
|
prop = []
|
|
|
|
config.str4
|
|
|
|
#
|
|
|
|
config.read_write()
|
|
|
|
config.str4 = ['']
|
|
|
|
assert config.getowner(config.unwrap_from_path('str4')) == 'user'
|
|
|
|
config.read_only()
|
|
|
|
prop = []
|
|
|
|
try:
|
|
|
|
config.str4
|
|
|
|
except PropertiesOptionError as err:
|
|
|
|
prop = err.proptype
|
|
|
|
assert 'mandatory' in prop
|
|
|
|
#
|
|
|
|
config.read_write()
|
|
|
|
config.str4 = ['yes', '']
|
|
|
|
assert config.getowner(config.unwrap_from_path('str4')) == 'user'
|
|
|
|
config.read_only()
|
|
|
|
prop = []
|
|
|
|
try:
|
|
|
|
config.str4
|
|
|
|
except PropertiesOptionError as err:
|
|
|
|
prop = err.proptype
|
2013-04-16 22:44:16 +02:00
|
|
|
assert 'mandatory' in prop
|
2016-09-30 22:45:33 +02:00
|
|
|
try:
|
|
|
|
delete_session('config', config.impl_getsessionid())
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2013-04-16 22:44:16 +02:00
|
|
|
|
|
|
|
|
2013-04-17 21:33:34 +02:00
|
|
|
def test_mandatory_multi_append():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man010')
|
2013-04-17 21:33:34 +02:00
|
|
|
config.str3 = ['yes']
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_write()
|
2013-04-17 21:33:34 +02:00
|
|
|
config.str3.append(None)
|
2016-09-30 22:45:33 +02:00
|
|
|
try:
|
|
|
|
delete_session('config', config.impl_getsessionid())
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2013-04-17 21:33:34 +02:00
|
|
|
|
|
|
|
|
2013-04-16 22:44:16 +02:00
|
|
|
def test_mandatory_disabled():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man011')
|
2013-04-16 22:44:16 +02:00
|
|
|
setting = config.cfgimpl_get_settings()
|
|
|
|
config.str1
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_only()
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = []
|
|
|
|
try:
|
|
|
|
config.str1
|
2013-08-28 11:33:43 +02:00
|
|
|
except PropertiesOptionError as err:
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = err.proptype
|
|
|
|
assert prop == ['mandatory']
|
2013-04-20 17:30:05 +02:00
|
|
|
setting[descr.str1].append('disabled')
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = []
|
|
|
|
try:
|
|
|
|
config.str1
|
2013-08-28 11:33:43 +02:00
|
|
|
except PropertiesOptionError as err:
|
2013-04-16 22:44:16 +02:00
|
|
|
prop = err.proptype
|
2013-08-28 11:33:43 +02:00
|
|
|
assert set(prop) == set(['disabled', 'mandatory'])
|
2016-09-30 22:45:33 +02:00
|
|
|
try:
|
|
|
|
delete_session('config', config.impl_getsessionid())
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2013-04-16 22:44:16 +02:00
|
|
|
|
|
|
|
|
2013-04-17 22:06:10 +02:00
|
|
|
def test_mandatory_unicode():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man012')
|
2013-04-17 22:06:10 +02:00
|
|
|
config.unicode2
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_only()
|
2013-04-17 22:06:10 +02:00
|
|
|
prop = []
|
|
|
|
try:
|
|
|
|
config.unicode2
|
2013-08-28 11:33:43 +02:00
|
|
|
except PropertiesOptionError as err:
|
2013-04-17 22:06:10 +02:00
|
|
|
prop = err.proptype
|
|
|
|
assert prop == ['mandatory']
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_write()
|
2013-04-17 22:06:10 +02:00
|
|
|
config.unicode2 = u''
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_only()
|
2013-04-17 22:06:10 +02:00
|
|
|
prop = []
|
|
|
|
try:
|
|
|
|
config.unicode2
|
2013-08-28 11:33:43 +02:00
|
|
|
except PropertiesOptionError as err:
|
2013-04-17 22:06:10 +02:00
|
|
|
prop = err.proptype
|
|
|
|
assert prop == ['mandatory']
|
2016-09-30 22:45:33 +02:00
|
|
|
try:
|
|
|
|
delete_session('config', config.impl_getsessionid())
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2013-04-17 22:06:10 +02:00
|
|
|
|
|
|
|
|
2013-04-16 22:44:16 +02:00
|
|
|
def test_mandatory_warnings_ro():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man013')
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str = ''
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_only()
|
2013-04-16 22:44:16 +02:00
|
|
|
proc = []
|
|
|
|
try:
|
|
|
|
config.str
|
2013-08-28 11:33:43 +02:00
|
|
|
except PropertiesOptionError as err:
|
2013-04-16 22:44:16 +02:00
|
|
|
proc = err.proptype
|
|
|
|
assert proc == ['mandatory']
|
2015-10-29 09:03:13 +01:00
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'unicode2', 'str3']
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_write()
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str = 'a'
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_only()
|
2015-10-29 09:03:13 +01:00
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str1', 'unicode2', 'str3']
|
2016-09-30 22:45:33 +02:00
|
|
|
try:
|
|
|
|
delete_session('config', config.impl_getsessionid())
|
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2013-04-16 22:44:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_mandatory_warnings_rw():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man100')
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str = ''
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_write()
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str
|
2015-10-29 09:03:13 +01:00
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'unicode2', 'str3']
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str = 'a'
|
2015-10-29 09:03:13 +01:00
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str1', 'unicode2', 'str3']
|
2016-03-29 09:31:00 +02:00
|
|
|
try:
|
2016-09-30 22:45:33 +02:00
|
|
|
delete_session('config', 'man100')
|
2016-03-29 09:31:00 +02:00
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2013-04-16 22:44:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_mandatory_warnings_disabled():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man101')
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str = ''
|
|
|
|
setting = config.cfgimpl_get_settings()
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_write()
|
2013-04-16 22:44:16 +02:00
|
|
|
config.str
|
2015-10-29 09:03:13 +01:00
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'unicode2', 'str3']
|
2013-04-20 17:30:05 +02:00
|
|
|
setting[descr.str].append('disabled')
|
2015-10-29 09:03:13 +01:00
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str1', 'unicode2', 'str3']
|
2016-03-29 09:31:00 +02:00
|
|
|
try:
|
2016-09-30 22:45:33 +02:00
|
|
|
delete_session('config', 'man101')
|
2016-03-29 09:31:00 +02:00
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2013-04-17 21:33:34 +02:00
|
|
|
|
|
|
|
|
2014-10-26 16:39:24 +01:00
|
|
|
def test_mandatory_warnings_hidden():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man102')
|
2014-10-26 16:39:24 +01:00
|
|
|
config.str = ''
|
|
|
|
setting = config.cfgimpl_get_settings()
|
|
|
|
config.read_write()
|
|
|
|
config.cfgimpl_get_settings().setpermissive(('hidden',))
|
|
|
|
config.str
|
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'unicode2', 'str3']
|
|
|
|
setting[descr.str].append('hidden')
|
2016-10-14 21:31:39 +02:00
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'unicode2', 'str3']
|
2016-03-29 09:31:00 +02:00
|
|
|
try:
|
2016-09-30 22:45:33 +02:00
|
|
|
delete_session('config', 'man102')
|
2016-03-29 09:31:00 +02:00
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2014-10-26 16:39:24 +01:00
|
|
|
|
|
|
|
|
2013-04-17 21:33:34 +02:00
|
|
|
def test_mandatory_warnings_frozen():
|
|
|
|
descr = make_description()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man103')
|
2013-04-17 21:33:34 +02:00
|
|
|
config.str = ''
|
|
|
|
setting = config.cfgimpl_get_settings()
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_write()
|
2013-04-17 21:33:34 +02:00
|
|
|
config.str
|
2015-10-29 09:03:13 +01:00
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'unicode2', 'str3']
|
2013-04-20 17:30:05 +02:00
|
|
|
setting[descr.str].append('frozen')
|
2013-04-22 09:19:05 +02:00
|
|
|
config.read_only()
|
2015-10-29 09:03:13 +01:00
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'unicode2', 'str3']
|
2016-03-29 09:31:00 +02:00
|
|
|
try:
|
2016-09-30 22:45:33 +02:00
|
|
|
delete_session('config', 'man103')
|
2016-03-29 09:31:00 +02:00
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2015-07-26 18:55:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
def test_mandatory_master():
|
|
|
|
ip_admin_eth0 = StrOption('ip_admin_eth0', "ip réseau autorisé", multi=True,
|
|
|
|
properties=('mandatory', ))
|
|
|
|
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)
|
|
|
|
o = OptionDescription('o', '', [interface1])
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(o, session_id='man104')
|
2015-07-26 18:55:21 +02:00
|
|
|
config.read_only()
|
|
|
|
raises(PropertiesOptionError, 'config.ip_admin_eth0.ip_admin_eth0')
|
|
|
|
raises(PropertiesOptionError, 'config.ip_admin_eth0.netmask_admin_eth0')
|
2016-03-29 09:31:00 +02:00
|
|
|
try:
|
2016-09-30 22:45:33 +02:00
|
|
|
delete_session('config', 'man104')
|
2016-03-29 09:31:00 +02:00
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2015-07-26 18:55:21 +02:00
|
|
|
|
|
|
|
|
2016-06-29 21:42:54 +02:00
|
|
|
def test_mandatory_warnings_master():
|
|
|
|
ip_admin_eth0 = StrOption('ip_admin_eth0', "ip réseau autorisé", multi=True,
|
|
|
|
properties=('mandatory', ))
|
|
|
|
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)
|
|
|
|
o = OptionDescription('o', '', [interface1])
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(o, session_id='man105')
|
2016-06-29 21:42:54 +02:00
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['ip_admin_eth0.ip_admin_eth0']
|
|
|
|
try:
|
2016-09-30 22:45:33 +02:00
|
|
|
delete_session('config', 'man105')
|
2016-06-29 21:42:54 +02:00
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
|
|
|
|
|
|
|
|
2015-07-26 18:55:21 +02:00
|
|
|
def test_mandatory_master_empty():
|
|
|
|
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)
|
|
|
|
o = OptionDescription('o', '', [interface1])
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(o, session_id='man106')
|
2015-07-26 18:55:21 +02:00
|
|
|
config.read_write()
|
|
|
|
assert config.ip_admin_eth0.ip_admin_eth0 == []
|
|
|
|
assert config.ip_admin_eth0.netmask_admin_eth0 == []
|
|
|
|
#
|
|
|
|
config.ip_admin_eth0.ip_admin_eth0.append()
|
|
|
|
assert config.ip_admin_eth0.ip_admin_eth0 == [None]
|
|
|
|
assert config.ip_admin_eth0.netmask_admin_eth0 == [None]
|
|
|
|
config.read_only()
|
|
|
|
raises(PropertiesOptionError, "config.ip_admin_eth0.ip_admin_eth0")
|
|
|
|
raises(PropertiesOptionError, "config.ip_admin_eth0.netmask_admin_eth0")
|
|
|
|
config.read_write()
|
|
|
|
del(config.ip_admin_eth0.ip_admin_eth0)
|
|
|
|
del(config.ip_admin_eth0.netmask_admin_eth0)
|
|
|
|
assert config.ip_admin_eth0.ip_admin_eth0 == []
|
|
|
|
assert config.ip_admin_eth0.netmask_admin_eth0 == []
|
|
|
|
#
|
|
|
|
config.ip_admin_eth0.ip_admin_eth0.append('')
|
|
|
|
assert config.ip_admin_eth0.ip_admin_eth0 == ['']
|
|
|
|
assert config.ip_admin_eth0.netmask_admin_eth0 == [None]
|
|
|
|
config.read_only()
|
|
|
|
raises(PropertiesOptionError, "config.ip_admin_eth0.ip_admin_eth0")
|
|
|
|
raises(PropertiesOptionError, "config.ip_admin_eth0.netmask_admin_eth0")
|
|
|
|
config.read_write()
|
|
|
|
#
|
|
|
|
config.read_write()
|
|
|
|
config.ip_admin_eth0.ip_admin_eth0 = ['ip']
|
|
|
|
config.read_only()
|
|
|
|
assert config.ip_admin_eth0.ip_admin_eth0 == ['ip']
|
|
|
|
assert config.ip_admin_eth0.netmask_admin_eth0 == [None]
|
2017-05-06 19:54:20 +02:00
|
|
|
#
|
|
|
|
config.read_write()
|
|
|
|
config.ip_admin_eth0.netmask_admin_eth0 = ['ip2']
|
|
|
|
config.read_only()
|
|
|
|
raises(PropertiesOptionError, "del(config.ip_admin_eth0.netmask_admin_eth0)")
|
|
|
|
raises(PropertiesOptionError, "del(config.ip_admin_eth0.ip_admin_eth0)")
|
|
|
|
config.read_write()
|
|
|
|
del(config.ip_admin_eth0.netmask_admin_eth0)
|
|
|
|
del(config.ip_admin_eth0.ip_admin_eth0)
|
2016-03-29 09:31:00 +02:00
|
|
|
try:
|
2016-09-30 22:45:33 +02:00
|
|
|
delete_session('config', 'man106')
|
2016-03-29 09:31:00 +02:00
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2015-07-26 18:55:21 +02:00
|
|
|
|
|
|
|
|
2016-06-29 21:42:54 +02:00
|
|
|
def test_mandatory_warnings_master_empty():
|
|
|
|
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)
|
|
|
|
o = OptionDescription('o', '', [interface1])
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(o, session_id='man107')
|
2016-06-29 21:42:54 +02:00
|
|
|
config.read_write()
|
|
|
|
config.ip_admin_eth0.ip_admin_eth0.append()
|
|
|
|
assert config.ip_admin_eth0.ip_admin_eth0 == [None]
|
|
|
|
assert config.ip_admin_eth0.netmask_admin_eth0 == [None]
|
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['ip_admin_eth0.ip_admin_eth0']
|
|
|
|
del(config.ip_admin_eth0.ip_admin_eth0)
|
|
|
|
del(config.ip_admin_eth0.netmask_admin_eth0)
|
|
|
|
#
|
|
|
|
config.ip_admin_eth0.ip_admin_eth0.append('')
|
|
|
|
assert config.ip_admin_eth0.ip_admin_eth0 == ['']
|
|
|
|
assert config.ip_admin_eth0.netmask_admin_eth0 == [None]
|
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['ip_admin_eth0.ip_admin_eth0']
|
|
|
|
#
|
|
|
|
config.read_write()
|
|
|
|
config.ip_admin_eth0.ip_admin_eth0 = ['ip']
|
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == []
|
|
|
|
try:
|
2016-09-30 22:45:33 +02:00
|
|
|
delete_session('config', 'man107')
|
2016-06-29 21:42:54 +02:00
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
|
|
|
|
|
|
|
|
2015-07-26 18:55:21 +02:00
|
|
|
def test_mandatory_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, properties=('mandatory', ))
|
|
|
|
interface1 = OptionDescription('ip_admin_eth0', '', [ip_admin_eth0, netmask_admin_eth0])
|
|
|
|
interface1.impl_set_group_type(groups.master)
|
|
|
|
o = OptionDescription('o', '', [interface1])
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(o, session_id='man108')
|
2015-07-26 18:55:21 +02:00
|
|
|
config.read_only()
|
|
|
|
assert config.ip_admin_eth0.ip_admin_eth0 == []
|
|
|
|
assert config.ip_admin_eth0.netmask_admin_eth0 == []
|
|
|
|
#
|
|
|
|
config.read_write()
|
|
|
|
config.ip_admin_eth0.ip_admin_eth0.append('ip')
|
|
|
|
config.read_only()
|
|
|
|
assert config.ip_admin_eth0.ip_admin_eth0 == ['ip']
|
2016-11-14 21:14:45 +01:00
|
|
|
assert len(config.ip_admin_eth0.netmask_admin_eth0) == 1
|
|
|
|
raises(PropertiesOptionError, 'config.ip_admin_eth0.netmask_admin_eth0[0]')
|
2015-07-26 18:55:21 +02:00
|
|
|
#
|
|
|
|
config.read_write()
|
|
|
|
config.ip_admin_eth0.netmask_admin_eth0 = ['']
|
|
|
|
config.read_only()
|
|
|
|
assert config.ip_admin_eth0.ip_admin_eth0 == ['ip']
|
2016-11-14 21:14:45 +01:00
|
|
|
assert len(config.ip_admin_eth0.netmask_admin_eth0) == 1
|
|
|
|
raises(PropertiesOptionError, 'config.ip_admin_eth0.netmask_admin_eth0[0]')
|
2015-07-26 18:55:21 +02:00
|
|
|
#
|
|
|
|
config.read_write()
|
|
|
|
config.ip_admin_eth0.netmask_admin_eth0 = ['ip']
|
|
|
|
config.read_only()
|
|
|
|
assert config.ip_admin_eth0.ip_admin_eth0 == ['ip']
|
|
|
|
assert config.ip_admin_eth0.netmask_admin_eth0 == ['ip']
|
2016-03-29 09:31:00 +02:00
|
|
|
try:
|
2016-09-30 22:45:33 +02:00
|
|
|
delete_session('config', 'man108')
|
2016-03-29 09:31:00 +02:00
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2015-10-29 09:03:13 +01:00
|
|
|
|
|
|
|
|
2016-06-29 21:42:54 +02:00
|
|
|
def test_mandatory_warnings_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, properties=('mandatory', ))
|
|
|
|
interface1 = OptionDescription('ip_admin_eth0', '', [ip_admin_eth0, netmask_admin_eth0])
|
|
|
|
interface1.impl_set_group_type(groups.master)
|
|
|
|
o = OptionDescription('o', '', [interface1])
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(o, session_id='man109')
|
2016-06-29 21:42:54 +02:00
|
|
|
config.read_only()
|
|
|
|
assert config.ip_admin_eth0.ip_admin_eth0 == []
|
|
|
|
assert config.ip_admin_eth0.netmask_admin_eth0 == []
|
|
|
|
#
|
|
|
|
config.read_write()
|
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == []
|
|
|
|
config.ip_admin_eth0.ip_admin_eth0.append('ip')
|
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['ip_admin_eth0.netmask_admin_eth0']
|
|
|
|
try:
|
2016-09-30 22:45:33 +02:00
|
|
|
delete_session('config', 'man109')
|
2016-06-29 21:42:54 +02:00
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
|
|
|
|
|
|
|
|
2015-10-29 09:03:13 +01:00
|
|
|
def test_mandatory_warnings_symlink():
|
|
|
|
descr = make_description_sym()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man110')
|
2015-10-29 09:03:13 +01:00
|
|
|
config.str = ''
|
|
|
|
setting = config.cfgimpl_get_settings()
|
|
|
|
config.read_write()
|
|
|
|
config.str
|
2016-03-16 22:33:28 +01:00
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'str3']
|
2015-10-29 09:03:13 +01:00
|
|
|
setting[descr.str].append('frozen')
|
|
|
|
config.read_only()
|
2016-03-16 22:33:28 +01:00
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'str3']
|
2016-03-29 09:31:00 +02:00
|
|
|
try:
|
2016-09-30 22:45:33 +02:00
|
|
|
delete_session('config', 'man110')
|
2016-03-29 09:31:00 +02:00
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2015-10-29 09:03:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
def test_mandatory_warnings_validate():
|
|
|
|
descr = make_description3()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man111')
|
2015-10-29 09:03:13 +01:00
|
|
|
config.str = ''
|
|
|
|
raises(ValueError, "list(config.cfgimpl_get_values().mandatory_warnings())")
|
|
|
|
config.str = 'test'
|
|
|
|
raises(ValueError, "list(config.cfgimpl_get_values().mandatory_warnings())")
|
2016-03-29 09:31:00 +02:00
|
|
|
try:
|
2016-09-30 22:45:33 +02:00
|
|
|
delete_session('config', 'man111')
|
2016-03-29 09:31:00 +02:00
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2015-10-29 09:03:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
def test_mandatory_warnings_validate_empty():
|
|
|
|
descr = make_description2()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man112')
|
2015-10-29 09:03:13 +01:00
|
|
|
config.str = ''
|
|
|
|
config.read_only()
|
2016-10-14 21:31:39 +02:00
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'str3', 'unicode1']
|
2016-03-29 09:31:00 +02:00
|
|
|
try:
|
2016-09-30 22:45:33 +02:00
|
|
|
delete_session('config', 'man112')
|
2016-03-29 09:31:00 +02:00
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2015-10-29 09:03:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
def test_mandatory_warnings_requires():
|
|
|
|
descr = make_description4()
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(descr, session_id='man113')
|
2015-10-29 09:03:13 +01:00
|
|
|
config.str = ''
|
|
|
|
config.read_write()
|
|
|
|
config.str
|
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'unicode2']
|
|
|
|
config.read_only()
|
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str', 'str1', 'unicode2']
|
|
|
|
config.read_write()
|
|
|
|
config.str = 'yes'
|
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['str1', 'unicode2', 'str3']
|
2016-03-29 09:31:00 +02:00
|
|
|
try:
|
2016-09-30 22:45:33 +02:00
|
|
|
delete_session('config', 'man113')
|
2016-03-29 09:31:00 +02:00
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|
2015-10-29 09:03:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
def test_mandatory_od_disabled():
|
|
|
|
descr = make_description()
|
|
|
|
od = OptionDescription('od', '', [descr])
|
2016-09-30 22:45:33 +02:00
|
|
|
config = Config(od, session_id='man114')
|
2015-10-29 09:03:13 +01:00
|
|
|
config.read_only()
|
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == ['tiram.str1', 'tiram.unicode2', 'tiram.str3']
|
|
|
|
config.cfgimpl_get_settings()[descr].append('disabled')
|
|
|
|
assert list(config.cfgimpl_get_values().mandatory_warnings()) == []
|
2016-03-29 09:31:00 +02:00
|
|
|
try:
|
2016-09-30 22:45:33 +02:00
|
|
|
delete_session('config', 'man114')
|
2016-03-29 09:31:00 +02:00
|
|
|
except ValueError:
|
|
|
|
pass
|
|
|
|
del(config)
|