diff --git a/src/web/ractl_cmds.py b/src/web/ractl_cmds.py index 644932a5..709cf5c4 100644 --- a/src/web/ractl_cmds.py +++ b/src/web/ractl_cmds.py @@ -64,14 +64,12 @@ def get_type(scsi_id): return list_devices()[int(scsi_id)]["type"] -def attach_image(scsi_id, image, device_type): - if device_type == "SCCD" and get_type(scsi_id) == "SCCD": +def attach_image(scsi_id, image, image_type): + if image_type == "SCCD" and get_type(scsi_id) == "SCCD": return insert(scsi_id, image) - elif device_type == "SCDP": - attach_daynaport(scsi_id) else: return subprocess.run( - ["rasctl", "-c", "attach", "-t", device_type, "-i", scsi_id, "-f", image], + ["rasctl", "-c", "attach", "-t", image_type, "-i", scsi_id, "-f", image], capture_output=True, ) diff --git a/src/web/web.py b/src/web/web.py index 4fdd1cc7..9c5dd0bc 100644 --- a/src/web/web.py +++ b/src/web/web.py @@ -137,9 +137,9 @@ def attach(): print("valid_file_types: ", valid_file_types) if re.match(valid_file_types, file_name): if file_name.lower().endswith((".iso", ".cdr", ".toast", ".img")): - image_type = "cd" + image_type = "SCCD" else: - image_type = "hd" + image_type = "SCHD" else: flash(f"Unknown file type. Valid files are: {', '.join(valid_file_suffix)}", "error") return redirect(url_for("index"))