make enforce_type=True in CONF.set_override
Each config option has limitation for type and value. If we use method CONF.set_override without parameter enforce_type=True, we may pass wrong type to config option. This commit makes sure calling method CONF.set_override with enforce_type=True. Change-Id: I1430c93777d6e5d98086a8700663ab9f58c1e5ab Closes-Bug: #1517839
This commit is contained in:
parent
91273fed79
commit
ca6c34ac71
@ -128,7 +128,7 @@ class ConfFixture(fixtures.Fixture):
|
|||||||
|
|
||||||
@transport_driver.setter
|
@transport_driver.setter
|
||||||
def transport_driver(self, value):
|
def transport_driver(self, value):
|
||||||
self.conf.set_override('rpc_backend', value)
|
self.conf.set_override('rpc_backend', value, enforce_type=True)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def response_timeout(self):
|
def response_timeout(self):
|
||||||
@ -137,4 +137,5 @@ class ConfFixture(fixtures.Fixture):
|
|||||||
|
|
||||||
@response_timeout.setter
|
@response_timeout.setter
|
||||||
def response_timeout(self, value):
|
def response_timeout(self, value):
|
||||||
self.conf.set_override('rpc_response_timeout', value)
|
self.conf.set_override('rpc_response_timeout', value,
|
||||||
|
enforce_type=True)
|
||||||
|
@ -221,7 +221,7 @@ class TestCallTimeout(test_utils.BaseTestCase):
|
|||||||
('all_none',
|
('all_none',
|
||||||
dict(confval=None, ctor=None, prepare=_notset, expect=None)),
|
dict(confval=None, ctor=None, prepare=_notset, expect=None)),
|
||||||
('confval',
|
('confval',
|
||||||
dict(confval=21.1, ctor=None, prepare=_notset, expect=21.1)),
|
dict(confval=21, ctor=None, prepare=_notset, expect=21)),
|
||||||
('ctor',
|
('ctor',
|
||||||
dict(confval=None, ctor=21.1, prepare=_notset, expect=21.1)),
|
dict(confval=None, ctor=21.1, prepare=_notset, expect=21.1)),
|
||||||
('ctor_zero',
|
('ctor_zero',
|
||||||
|
@ -57,7 +57,7 @@ class BaseTestCase(base.BaseTestCase):
|
|||||||
"""
|
"""
|
||||||
group = kw.pop('group', None)
|
group = kw.pop('group', None)
|
||||||
for k, v in six.iteritems(kw):
|
for k, v in six.iteritems(kw):
|
||||||
self.conf.set_override(k, v, group)
|
self.conf.set_override(k, v, group, enforce_type=True)
|
||||||
|
|
||||||
|
|
||||||
class ServerThreadHelper(threading.Thread):
|
class ServerThreadHelper(threading.Thread):
|
||||||
|
Loading…
Reference in New Issue
Block a user