diff --git a/qa/tasks/mgr/dashboard/test_cluster_configuration.py b/qa/tasks/mgr/dashboard/test_cluster_configuration.py index dc96bced02a..9c8245d238d 100644 --- a/qa/tasks/mgr/dashboard/test_cluster_configuration.py +++ b/qa/tasks/mgr/dashboard/test_cluster_configuration.py @@ -369,7 +369,7 @@ class ClusterConfigurationTest(DashboardTestCase): self.assertIn('type', data) self.assertIn('desc', data) self.assertIn(data['type'], ['str', 'bool', 'float', 'int', 'size', 'uint', 'addr', - 'addrvec', 'uuid', 'secs']) + 'addrvec', 'uuid', 'secs', 'millisecs']) if 'value' in data: self.assertIn('source', data) diff --git a/src/common/options.cc b/src/common/options.cc index 367e52ee0db..0f495673302 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -49,6 +49,9 @@ public: void operator()(const std::chrono::seconds v) const { out << v.count(); } + void operator()(const std::chrono::milliseconds v) const { + out << v.count(); + } }; } @@ -203,6 +206,13 @@ int Option::parse_value( *error_message = e.what(); return -EINVAL; } + } else if (type == Option::TYPE_MILLISECS) { + try { + *out = boost::lexical_cast(val); + } catch (const boost::bad_lexical_cast& e) { + *error_message = e.what(); + return -EINVAL; + } } else { ceph_abort(); } @@ -7894,6 +7904,37 @@ static std::vector