Skip to content

Commit

Permalink
OT: normalize data in children
Browse files Browse the repository at this point in the history
  • Loading branch information
ofaurax committed Nov 4, 2024
1 parent 0fb69fb commit 90cdffd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packethardware/component/disk.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def __init__(self, lsblk):
}
self.lsblk["rota"] = self.data["rota"]
self.lsblk["size"] = self.data["size"]
if "children" in self.lsblk:
for c in self.lsblk["children"]:
c["rota"] = c["rota"] if isinstance(c["rota"], str) else "1" if c["rota"] else "0"
c["size"] = str(c["size"])

if self.__is_nvme():
self.data["smart"] = utils.get_nvme_attributes(self.lsblk["name"])
Expand Down

0 comments on commit 90cdffd

Please sign in to comment.