removed parent, wasn't very useful and caused problems across versions
fixed cache expiration
This commit is contained in:
parent
900a9f9556
commit
b65536bc56
1 changed files with 5 additions and 7 deletions
|
@ -77,8 +77,8 @@ def cache_available(cache_item, config):
|
||||||
|
|
||||||
if config.has_option('cache', 'max_age'):
|
if config.has_option('cache', 'max_age'):
|
||||||
maxage = config.get('cache', 'max_age')
|
maxage = config.get('cache', 'max_age')
|
||||||
|
fileage = int( time.time() - existing.st_mtime )
|
||||||
if (existing.st_mtime - int(time.time())) <= maxage:
|
if (maxage > fileage):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
@ -88,9 +88,7 @@ def get_host_info(host):
|
||||||
|
|
||||||
hostinfo = {
|
hostinfo = {
|
||||||
'vmware_name' : host.name,
|
'vmware_name' : host.name,
|
||||||
'vmware_parent': host.parent.name,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for k in host.capability.__dict__.keys():
|
for k in host.capability.__dict__.keys():
|
||||||
if k.startswith('_'):
|
if k.startswith('_'):
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue