Skip to content

Commit

Permalink
fix: changed to os.mkdirs
Browse files Browse the repository at this point in the history
  • Loading branch information
amunchet committed Sep 16, 2023
1 parent 58398ca commit c269afc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions backend/ansible_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions backend/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c269afc

Please sign in to comment.