From df458a8bf0e4890b8b338845f88a9bfd15045c17 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 4 Nov 2019 12:51:08 -0600 Subject: [PATCH] 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 --- src/pybind/mgr/orchestrator.py | 8 ++++---- src/pybind/mgr/ssh/module.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pybind/mgr/orchestrator.py b/src/pybind/mgr/orchestrator.py index 4057b2f4e4508..1fa5427d54c5a 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 4471a1c2ac986..33cae564bfa29 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', }, ] -- 2.39.5