diff --git a/oslo_config/tests/test_types.py b/oslo_config/tests/test_types.py index 1d8e160c..3824adb9 100644 --- a/oslo_config/tests/test_types.py +++ b/oslo_config/tests/test_types.py @@ -208,6 +208,7 @@ class IntegerTypeTests(TypeTestHelper, unittest.TestCase): t(123) t(300) t(456) + self.assertRaises(ValueError, t, 0) self.assertRaises(ValueError, t, 457) diff --git a/oslo_config/types.py b/oslo_config/types.py index 9b646e25..ed40dfc2 100644 --- a/oslo_config/types.py +++ b/oslo_config/types.py @@ -144,7 +144,7 @@ class Integer(ConfigType): else: value = int(value) - if value: + if value is not None: self._check_range(value) return value