This commit is contained in:
Maxim Devaev 2023-03-05 19:07:36 +02:00
parent 7a1f8f32da
commit acf55a3b27
2 changed files with 5 additions and 3 deletions

View File

@ -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:

View File

@ -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)))