Merge branch 'develop' into uweseimet_develop

This commit is contained in:
Uwe Seimet 2021-08-23 10:30:52 +02:00
commit 0c7d185eb8
2 changed files with 5 additions and 7 deletions

View File

@ -64,14 +64,12 @@ def get_type(scsi_id):
return list_devices()[int(scsi_id)]["type"] return list_devices()[int(scsi_id)]["type"]
def attach_image(scsi_id, image, device_type): def attach_image(scsi_id, image, image_type):
if device_type == "SCCD" and get_type(scsi_id) == "SCCD": if image_type == "SCCD" and get_type(scsi_id) == "SCCD":
return insert(scsi_id, image) return insert(scsi_id, image)
elif device_type == "SCDP":
attach_daynaport(scsi_id)
else: else:
return subprocess.run( 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, capture_output=True,
) )

View File

@ -137,9 +137,9 @@ def attach():
print("valid_file_types: ", valid_file_types) print("valid_file_types: ", valid_file_types)
if re.match(valid_file_types, file_name): if re.match(valid_file_types, file_name):
if file_name.lower().endswith((".iso", ".cdr", ".toast", ".img")): if file_name.lower().endswith((".iso", ".cdr", ".toast", ".img")):
image_type = "cd" image_type = "SCCD"
else: else:
image_type = "hd" image_type = "SCHD"
else: else:
flash(f"Unknown file type. Valid files are: {', '.join(valid_file_suffix)}", "error") flash(f"Unknown file type. Valid files are: {', '.join(valid_file_suffix)}", "error")
return redirect(url_for("index")) return redirect(url_for("index"))