summaryrefslogtreecommitdiff
path: root/oslo_config
diff options
context:
space:
mode:
Diffstat (limited to 'oslo_config')
-rw-r--r--oslo_config/tests/test_types.py5
-rw-r--r--oslo_config/types.py2
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: