{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/11505","labels_url":"https://api.github.com/repos/ansible/ansible/issues/11505/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/11505/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/11505/events","html_url":"https://github.com/ansible/ansible/issues/11505","id":93385409,"number":11505,"title":"vmware inventory script has incorrect cache age checking","user":{"login":"greg-peterson","id":2829381,"avatar_url":"https://avatars.githubusercontent.com/u/2829381?v=3","gravatar_id":"","url":"https://api.github.com/users/greg-peterson","html_url":"https://github.com/greg-peterson","followers_url":"https://api.github.com/users/greg-peterson/followers","following_url":"https://api.github.com/users/greg-peterson/following{/other_user}","gists_url":"https://api.github.com/users/greg-peterson/gists{/gist_id}","starred_url":"https://api.github.com/users/greg-peterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greg-peterson/subscriptions","organizations_url":"https://api.github.com/users/greg-peterson/orgs","repos_url":"https://api.github.com/users/greg-peterson/repos","events_url":"https://api.github.com/users/greg-peterson/events{/privacy}","received_events_url":"https://api.github.com/users/greg-peterson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible/labels/bug_report","name":"bug_report","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-06T21:52:37Z","updated_at":"2015-07-06T22:11:26Z","closed_at":"2015-07-06T22:01:45Z","body":"Issue Type:\r\n\r\nBug Report.\r\n\r\nAnsible Version:\r\n\r\n1.9.1\r\n\r\nAnsible Configuration:\r\n\r\nnot relevent\r\n\r\nEnvironment:\r\n\r\nUbuntu\r\n\r\nSummary:\r\n\r\nplugins/inventory/vmware.py line 118:\r\nif (cache_stat.st_mtime + cache_max_age) < time.time():\r\n\r\ncomparision should be > or >=\r\n\r\nSteps To Reproduce:\r\n\r\nNot sure\r\n\r\nExpected Results:\r\n\r\nCache gets used properly\r\n\r\nActual Results:\r\n\r\nCache is never used"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/119011336","html_url":"https://github.com/ansible/ansible/issues/11505#issuecomment-119011336","issue_url":"https://api.github.com/repos/ansible/ansible/issues/11505","id":119011336,"user":{"login":"greg-peterson","id":2829381,"avatar_url":"https://avatars.githubusercontent.com/u/2829381?v=3","gravatar_id":"","url":"https://api.github.com/users/greg-peterson","html_url":"https://github.com/greg-peterson","followers_url":"https://api.github.com/users/greg-peterson/followers","following_url":"https://api.github.com/users/greg-peterson/following{/other_user}","gists_url":"https://api.github.com/users/greg-peterson/gists{/gist_id}","starred_url":"https://api.github.com/users/greg-peterson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greg-peterson/subscriptions","organizations_url":"https://api.github.com/users/greg-peterson/orgs","repos_url":"https://api.github.com/users/greg-peterson/repos","events_url":"https://api.github.com/users/greg-peterson/events{/privacy}","received_events_url":"https://api.github.com/users/greg-peterson/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T22:11:26Z","updated_at":"2015-07-06T22:11:26Z","body":"Please recheck.  I modified script like so (to test it), and you will see that the block of code to read the cache does not execute until the cache is at least cache_max_age seconds old.  Turn that less than into a greater than, and the cache gets read up until cache_max_age seconds after creation.\r\n\r\n                if (cache_stat.st_mtime + cache_max_age) < time.time():\r\n                    print 'using cache'\r\n                    with open(cache_file) as cache:"}}