mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Close all open filehandle (#50544)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
committed by
Brian Coca
parent
94a1d86d70
commit
db8702cdb8
@@ -748,7 +748,8 @@ def _find_module_utils(module_name, b_module_data, module_path, module_args, tas
|
||||
# the write lock. Go ahead and read the data from disk
|
||||
# instead of re-creating it.
|
||||
try:
|
||||
zipdata = open(cached_module_filename, 'rb').read()
|
||||
with open(cached_module_filename, 'rb') as f:
|
||||
zipdata = f.read()
|
||||
except IOError:
|
||||
raise AnsibleError('A different worker process failed to create module file. '
|
||||
'Look at traceback for that process for debugging information.')
|
||||
|
||||
Reference in New Issue
Block a user