From: Sage Weil Date: Mon, 4 Nov 2019 18:51:08 +0000 (-0600) Subject: mgr/ssh: change inventory_cache_timeout to seconds (not minutes) X-Git-Tag: v15.1.0~1020^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=df458a8bf0e4890b8b338845f88a9bfd15045c17;p=ceph.git mgr/ssh: change inventory_cache_timeout to seconds (not minutes) The descriptio didn't match the implementation (which took minutes). Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index 4057b2f4e450..1fa5427d54c5 100644 --- a/src/pybind/mgr/orchestrator.py +++ b/src/pybind/mgr/orchestrator.py @@ -1115,13 +1115,13 @@ class OutdatableData(object): def from_json(cls, data): return cls(data['data'], cls.time_from_string(data['last_refresh'])) - def outdated(self, timeout_min=None): - if timeout_min is None: - timeout_min = 10 + def outdated(self, timeout=None): + if timeout is None: + timeout = 600 if self.last_refresh is None: return True cutoff = datetime.datetime.utcnow() - datetime.timedelta( - minutes=timeout_min) + seconds=timeout) return self.last_refresh < cutoff def __repr__(self): diff --git a/src/pybind/mgr/ssh/module.py b/src/pybind/mgr/ssh/module.py index 4471a1c2ac98..33cae564bfa2 100644 --- a/src/pybind/mgr/ssh/module.py +++ b/src/pybind/mgr/ssh/module.py @@ -120,8 +120,8 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator): }, { 'name': 'inventory_cache_timeout', - 'type': 'int', - 'default': 10, + 'type': 'seconds', + 'default': 10 * 60, 'desc': 'seconds to cache device inventory', }, ]