]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/ssh: change inventory_cache_timeout to seconds (not minutes)
authorSage Weil <sage@redhat.com>
Mon, 4 Nov 2019 18:51:08 +0000 (12:51 -0600)
committerSage Weil <sage@redhat.com>
Wed, 6 Nov 2019 14:25:49 +0000 (08:25 -0600)
The descriptio didn't match the implementation (which took minutes).

Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/orchestrator.py
src/pybind/mgr/ssh/module.py

index 4057b2f4e450876afca88cfb516910850733fad6..1fa5427d54c5ae2e6b95749c9532274da11526b3 100644 (file)
@@ -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):
index 4471a1c2ac986b571c3ade18acd026050ee2f166..33cae564bfa293ae20405bb4721c80f2b01dccd1 100644 (file)
@@ -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',
         },
     ]