Fix handling of properties files when they're in subdirs (#1082)

- File operation class methods create parent dirs if they don't exist
- Avoid stripping path from file names in several places
- Simplify prop file matching logic: check for existence of file
- Remove list_files() method which is now unused
This commit is contained in:
Daniel Markstedt
2023-01-28 14:36:07 -08:00
committed by GitHub
parent 956195d67e
commit bf53958636
2 changed files with 20 additions and 34 deletions
+2 -2
View File
@@ -389,7 +389,7 @@ def drive_create():
Creates the image and properties file pair
"""
drive_name = request.form.get("drive_name")
file_name = Path(request.form.get("file_name")).name
file_name = Path(request.form.get("file_name"))
properties = get_properties_by_drive_name(APP.config["PISCSI_DRIVE_PROPERTIES"], drive_name)
@@ -432,7 +432,7 @@ def drive_cdrom():
Creates a properties file for a CD-ROM image
"""
drive_name = request.form.get("drive_name")
file_name = Path(request.form.get("file_name")).name
file_name = Path(request.form.get("file_name"))
# Creating the drive properties file
file_name = f"{file_name}.{PROPERTIES_SUFFIX}"