mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
Close all open filehandle (#50544)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
94a1d86d70
commit
db8702cdb8
21 changed files with 81 additions and 47 deletions
|
@ -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.')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue