mirror of
https://github.com/akuker/RASCSI.git
synced 2024-11-26 13:49:21 +00:00
Fix for issue#199. Also removed check for daynaport in attach_image() since that branch will never be reached in the current webui implementation. (#206)
This commit is contained in:
parent
66342dc18a
commit
795286f4c4
@ -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,
|
||||
)
|
||||
|
||||
|
@ -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"))
|
||||
|
Loading…
Reference in New Issue
Block a user