Replace commonprefix() with commonpath() (#3016)
This commit is contained in:
parent
3716df9bb7
commit
4dccd54cbd
|
|
@ -222,9 +222,12 @@ class DeviceHandler:
|
||||||
# "mountpoint": "/mnt/archinstall/.snapshots"
|
# "mountpoint": "/mnt/archinstall/.snapshots"
|
||||||
# "mountpoints": ["/mnt/archinstall/.snapshots", "/mnt/archinstall/home", ..]
|
# "mountpoints": ["/mnt/archinstall/.snapshots", "/mnt/archinstall/home", ..]
|
||||||
# so we'll determine the minimum common path and assume that's the root
|
# so we'll determine the minimum common path and assume that's the root
|
||||||
path_strings = [str(m) for m in lsblk_info.mountpoints]
|
try:
|
||||||
common_prefix = os.path.commonprefix(path_strings)
|
common_path = os.path.commonpath(lsblk_info.mountpoints)
|
||||||
mountpoint = Path(common_prefix)
|
except ValueError:
|
||||||
|
return subvol_infos
|
||||||
|
|
||||||
|
mountpoint = Path(common_path)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = SysCommand(f'btrfs subvolume list {mountpoint}').decode()
|
result = SysCommand(f'btrfs subvolume list {mountpoint}').decode()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue