Merge pull request #47617 from aesposito91/2018.3

Update napalm.py
This commit is contained in:
Nicole Thomas 2018-05-15 11:44:34 -04:00 committed by GitHub
commit d1a1a594e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -236,16 +236,7 @@ def get_grains():
'''
Retrieve facts from the network device.
'''
refresh_needed = False
refresh_needed = refresh_needed or (not DETAILS.get('grains_cache', {}))
refresh_needed = refresh_needed or (not DETAILS.get('grains_cache', {}).get('result', False))
refresh_needed = refresh_needed or (not DETAILS.get('grains_cache', {}).get('out', {}))
if refresh_needed:
facts = call('get_facts', **{})
DETAILS['grains_cache'] = facts
return DETAILS.get('grains_cache', {})
return call('get_facts', **{})
def grains_refresh():