diff options
author | Maxim Devaev <[email protected]> | 2023-03-05 19:07:36 +0200 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2023-03-05 19:35:17 +0200 |
commit | acf55a3b2742105af682999626dc733a110f5b86 (patch) | |
tree | 860fe240635de7e3b6513c0ed7a746a67a581290 | |
parent | 7a1f8f32da0550cc140d4ec6a6f3206e21a31a81 (diff) |
normpath
-rw-r--r-- | kvmd/fstab.py | 5 | ||||
-rw-r--r-- | kvmd/plugins/msd/otg/drive.py | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/kvmd/fstab.py b/kvmd/fstab.py index 20cd8101..0a4ee9a5 100644 --- a/kvmd/fstab.py +++ b/kvmd/fstab.py @@ -20,6 +20,7 @@ # ========================================================================== # +import os import re import dataclasses @@ -62,8 +63,8 @@ def _find_partitions(part_type: str, single: bool) -> list[Partition]: options = dict(re.findall(r"X-kvmd\.%s-(root|user)(?:=([^,]+))?" % (part_type), fields[3])) if options: parts.append(Partition( - mount_path=fields[1], - root_path=(options.get("root", "") or fields[1]), + mount_path=os.path.normpath(fields[1]), + root_path=os.path.normpath(options.get("root", "") or fields[1]), user=options.get("user", ""), )) if single: diff --git a/kvmd/plugins/msd/otg/drive.py b/kvmd/plugins/msd/otg/drive.py index 407aef9e..9fc947ab 100644 --- a/kvmd/plugins/msd/otg/drive.py +++ b/kvmd/plugins/msd/otg/drive.py @@ -57,7 +57,8 @@ class Drive: self.__set_param("forced_eject", "") def get_image_path(self) -> str: - return self.__get_param("file") + path = self.__get_param("file") + return (os.path.normpath(path) if path else "") def set_cdrom_flag(self, flag: bool) -> None: self.__set_param("cdrom", str(int(flag))) |