]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: use datetime_now() for last_facts_update
authorSage Weil <sage@newdream.net>
Tue, 2 Feb 2021 23:07:36 +0000 (17:07 -0600)
committerSage Weil <sage@newdream.net>
Tue, 2 Feb 2021 23:10:01 +0000 (17:10 -0600)
Be consistent!

Signed-off-by: Sage Weil <sage@newdream.net>
src/pybind/mgr/cephadm/inventory.py

index 8251821774859b005c525b54720db897eddeabd3..9340b8bf432e10e4c5d23fe88226b052d696bcd9 100644 (file)
@@ -298,7 +298,7 @@ class HostCache():
     def update_host_facts(self, host, facts):
         # type: (str, Dict[str, Dict[str, Any]]) -> None
         self.facts[host] = facts
-        self.last_facts_update[host] = datetime.datetime.utcnow()
+        self.last_facts_update[host] = datetime_now()
 
     def devices_changed(self, host: str, b: List[inventory.Device]) -> bool:
         a = self.devices[host]
@@ -544,7 +544,7 @@ class HostCache():
         if host in self.mgr.offline_hosts:
             logger.debug(f'Host "{host}" marked as offline. Skipping gather facts refresh')
             return False
-        cutoff = datetime.datetime.utcnow() - datetime.timedelta(
+        cutoff = datetime_now() - datetime.timedelta(
             seconds=self.mgr.facts_cache_timeout)
         if host not in self.last_facts_update or self.last_facts_update[host] < cutoff:
             return True