Skip to content

Commit

Permalink
Convert lsblk mountpoint str to Path object
Browse files Browse the repository at this point in the history
  • Loading branch information
codefiles committed Sep 8, 2024
1 parent 7235e21 commit 80df3d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion archinstall/lib/disk/device_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,7 @@ def json(self) -> Dict[str, Any]:
'fsavail': self.fsavail,
'fsuse_percentage': self.fsuse_percentage,
'type': self.type,
'mountpoint': self.mountpoint,
'mountpoint': str(self.mountpoint),
'mountpoints': [str(m) for m in self.mountpoints],
'fsroots': [str(r) for r in self.fsroots],
'children': [c.json() for c in self.children]
Expand Down Expand Up @@ -1393,6 +1393,8 @@ def from_json(cls, blockdevice: Dict[str, Any]) -> LsblkInfo:

lsblk_info.children = [LsblkInfo.from_json(child) for child in blockdevice.get('children', [])]

lsblk_info.mountpoint = Path(lsblk_info.mountpoint) if lsblk_info.mountpoint else None

# sometimes lsblk returns 'mountpoints': [null]
lsblk_info.mountpoints = [Path(mnt) for mnt in lsblk_info.mountpoints if mnt]

Expand Down

0 comments on commit 80df3d7

Please sign in to comment.