1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Ensure parent tempdir's existence (#17585)

While doing evil things with action plugins, I hit a code path in which
the mkdir here was failing due to lack of parent dir. Changing this to
makedirs made everything happy. Now, I'd obviously like to understand
why the parent dir exists in some places and not others - but I could
not find anywhere that C.DEFAULT_LOCAL_TMP is ensured to be created.
This commit is contained in:
Monty Taylor 2016-09-15 08:57:15 -05:00 committed by Brian Coca
parent 70e63ddf6c
commit cd6e01349e

View file

@ -647,7 +647,7 @@ def _find_snippet_imports(module_name, module_data, module_path, module_args, ta
if not os.path.exists(lookup_path): if not os.path.exists(lookup_path):
# Note -- if we have a global function to setup, that would # Note -- if we have a global function to setup, that would
# be a better place to run this # be a better place to run this
os.mkdir(lookup_path) os.makedirs(lookup_path)
display.debug('ANSIBALLZ: Writing module') display.debug('ANSIBALLZ: Writing module')
with open(cached_module_filename + '-part', 'wb') as f: with open(cached_module_filename + '-part', 'wb') as f:
f.write(zipdata) f.write(zipdata)