mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Create the temp directory if it doesn't exist
This commit is contained in:
parent
27a5e95541
commit
c5feb6859a
1 changed files with 3 additions and 0 deletions
|
@ -651,6 +651,9 @@ def temp_directory(name=None):
|
|||
else:
|
||||
directory_path = tempfile.mkdtemp(dir=RUNTIME_VARS.TMP)
|
||||
|
||||
if not os.path.isdir(directory_path):
|
||||
os.makedirs(directory_path)
|
||||
|
||||
yield directory_path
|
||||
|
||||
shutil.rmtree(directory_path, ignore_errors=True)
|
||||
|
|
Loading…
Add table
Reference in a new issue