mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Normalize usage of temp and tmp on tmp (#36221)
* Normalize usage of temp and tmp on tmp * Rename system_tmps system_tmpdirs * Add ANSIBLE_REMOTE_TMP spelling of environment variables
This commit is contained in:
@@ -988,7 +988,8 @@ def fetch_url(module, url, data=None, headers=None, method=None,
|
||||
module.fail_json(msg='urlparse is not installed')
|
||||
|
||||
# ensure we use proper tempdir
|
||||
tempfile.tempdir = module.tempdir
|
||||
old_tempdir = tempfile.tempdir
|
||||
tempfile.tempdir = module.tmpdir
|
||||
|
||||
# Get validate_certs from the module params
|
||||
validate_certs = module.params.get('validate_certs', True)
|
||||
@@ -1052,5 +1053,7 @@ def fetch_url(module, url, data=None, headers=None, method=None,
|
||||
except Exception as e:
|
||||
info.update(dict(msg="An unknown error occurred: %s" % to_native(e), status=-1),
|
||||
exception=traceback.format_exc())
|
||||
finally:
|
||||
tempfile.tempdir = old_tempdir
|
||||
|
||||
return r, info
|
||||
|
||||
Reference in New Issue
Block a user