diff options
author | Jenkins <jenkins@review.openstack.org> | 2017-03-28 16:17:43 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-03-28 16:17:43 +0000 |
commit | e523607ceff2d2134ee7b0124f9eea32cc6ec48a (patch) | |
tree | ee7f404290c95cf4ff61e2037b4c97a6ff536870 /oslo_config | |
parent | 4624e9694b796a181d57b7dc6d65df0a3d642183 (diff) | |
parent | 466fcc1755c4b5d17f184b81c9013a8902ecf085 (diff) | |
download | oslo-config-e523607ceff2d2134ee7b0124f9eea32cc6ec48a.tar.gz |
Merge "Fix conversion to item_type on __call__ in List type(again)"
Diffstat (limited to 'oslo_config')
-rw-r--r-- | oslo_config/tests/test_types.py | 5 | ||||
-rw-r--r-- | oslo_config/types.py | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/oslo_config/tests/test_types.py b/oslo_config/tests/test_types.py index 96f101b..1e357bd 100644 --- a/oslo_config/tests/test_types.py +++ b/oslo_config/tests/test_types.py @@ -531,6 +531,11 @@ class ListTypeTests(TypeTestHelper, unittest.TestCase): self.assertConvertedValue('1,2,3,5', [1, 2, 3, 5]) + def test_tuple_of_custom_type(self): + self.type_instance = types.List(types.Integer()) + self.assertConvertedValue(('1', '2', '3', '5'), + [1, 2, 3, 5]) + def test_bounds_parsing(self): self.type_instance = types.List(types.Integer(), bounds=True) self.assertConvertedValue('[1,2,3]', [1, 2, 3]) diff --git a/oslo_config/types.py b/oslo_config/types.py index 81f9cb6..743ed80 100644 --- a/oslo_config/types.py +++ b/oslo_config/types.py @@ -441,7 +441,7 @@ class List(ConfigType): def __call__(self, value): if isinstance(value, (list, tuple)): - return list(value) + return list(six.moves.map(self.item_type, value)) s = value.strip() if self.bounds: |