Fix image dir paths that was broken by refactoring (#329)

* Fix image download that was broken by images dir refactoring

* Fix two more instances of image dir path construction
This commit is contained in:
Daniel Markstedt 2021-10-14 17:47:33 -07:00 committed by GitHub
parent 156367a827
commit 8e0e0c89ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -171,7 +171,7 @@ def download_file_to_iso(scsi_id, url):
tmp_dir = "/tmp/" + str(tmp_ts) + "/"
os.mkdir(tmp_dir)
tmp_full_path = tmp_dir + file_name
iso_filename = server_info["image_dir"] + file_name + ".iso"
iso_filename = f"{server_info['image_dir']}/{file_name}.iso"
try:
urllib.request.urlretrieve(url, tmp_full_path)
@ -203,7 +203,7 @@ def download_image(url):
server_info = get_server_info()
file_name = url.split("/")[-1]
full_path = server_info["image_dir"] + file_name
full_path = f"{server_info['image_dir']}/{file_name}"
try:
urllib.request.urlretrieve(url, full_path)

View File

@ -583,7 +583,7 @@ def create_file():
def download():
image = request.form.get("image")
server_info = get_server_info()
return send_file(server_info["image_dir"] + image, as_attachment=True)
return send_file(f"{server_info['image_dir']}/{image}", as_attachment=True)
@app.route("/files/delete", methods=["POST"])