The descriptio didn't match the implementation (which took minutes).
Signed-off-by: Sage Weil <sage@redhat.com>
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):
},
{
'name': 'inventory_cache_timeout',
- 'type': 'int',
- 'default': 10,
+ 'type': 'seconds',
+ 'default': 10 * 60,
'desc': 'seconds to cache device inventory',
},
]