ignore closing file error when file not open
fixes #16268
(cherry picked from commit 07846f7bec
)
This commit is contained in:
parent
6e2651ce07
commit
97a9eaa299
1 changed files with 4 additions and 1 deletions
5
lib/ansible/plugins/cache/jsonfile.py
vendored
5
lib/ansible/plugins/cache/jsonfile.py
vendored
|
@ -101,7 +101,10 @@ class CacheModule(BaseCacheModule):
|
|||
else:
|
||||
f.write(jsonify(value))
|
||||
finally:
|
||||
f.close()
|
||||
try:
|
||||
f.close()
|
||||
except UnboundLocalError:
|
||||
pass
|
||||
|
||||
def has_expired(self, key):
|
||||
|
||||
|
|
Loading…
Reference in a new issue