diff --git a/backend/ansible_helper.py b/backend/ansible_helper.py index 5d24895..534a0a6 100644 --- a/backend/ansible_helper.py +++ b/backend/ansible_helper.py @@ -59,7 +59,7 @@ def check_file(filename, file_type, raw=""): if retval: if not os.path.exists("/src/uploads/ansible"): # pragma: no cover - os.mkdir("/src/uploads/ansible") + os.mkdirs("/src/uploads/ansible") shutil.move(temp_file, "/src/uploads/ansible/{}.yml".format(filename)) return [retval, x.stdout, x.stderr] @@ -145,11 +145,11 @@ def run_ansible( if not os.path.exists("/run"): # pragma: no cover os.mkdir("/run") - os.mkdir(RUN_DIR) + os.mkdirs(RUN_DIR) folders = ["inventory", "project", "vars", "env"] for folder in folders: - os.mkdir("{}/{}".format(RUN_DIR, folder)) + os.mkdirs("{}/{}".format(RUN_DIR, folder)) # Copy over playbook src_playbook = "{}/{}.yml".format(SRC_DIR, playbook) diff --git a/backend/serve.py b/backend/serve.py index 5cde387..12e6caf 100755 --- a/backend/serve.py +++ b/backend/serve.py @@ -155,7 +155,7 @@ def upload(file_type, override_token): # pragma: no cover return "No file selected", 409 if not os.path.exists("/src/uploads"): - os.mkdir("/src/uploads") + os.mkdirs("/src/uploads") if not os.path.exists("/src/uploads/{}".format(file_type)): os.mkdir("/src/uploads/{}".format(file_type)) @@ -1574,10 +1574,10 @@ def custom_dashboard_image_upload(override=""): file = request.files["file"] if not os.path.exists("/src/uploads"): - os.mkdir("/src/uploads") + os.mkdirs("/src/uploads") if not os.path.exists("/src/uploads/images"): - os.mkdir("/src/uploads/images") + os.mkdirs("/src/uploads/images") if override: filename = override