mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
now get_url defaults to module temp dir (#36218)
* now get_url and other modules default to module temp dir also fixed 'bare' exception * allow modules to work with older versions * updated docs per feedback
This commit is contained in:
@@ -241,7 +241,7 @@ JSON_CANDIDATES = ('text', 'json', 'javascript')
|
||||
|
||||
def write_file(module, url, dest, content):
|
||||
# create a tempfile with some test content
|
||||
fd, tmpsrc = tempfile.mkstemp()
|
||||
fd, tmpsrc = tempfile.mkstemp(dir=getattr(module, 'tmpdir', None))
|
||||
f = open(tmpsrc, 'wb')
|
||||
try:
|
||||
f.write(content)
|
||||
|
||||
Reference in New Issue
Block a user