Skip to content

fix: find storage#367

Open
CllaudiaB wants to merge 2 commits intoSolvik:masterfrom
CllaudiaB:disk
Open

fix: find storage#367
CllaudiaB wants to merge 2 commits intoSolvik:masterfrom
CllaudiaB:disk

Conversation

@CllaudiaB
Copy link
Collaborator

No description provided.

Comment on lines +121 to +134
elif "children" in obj:
for device in obj["children"]:
if device.get("class") == "disk":
self.disks.append(
{
"logicalname": device.get("logicalname"),
"product": device.get("product"),
"serial": device.get("serial"),
"version": device.get("version"),
"size": device.get("size"),
"description": device.get("description"),
"type": device.get("description"),
}
)
Copy link
Collaborator

@ribetm ribetm Feb 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems some controllers are nested one level deeper, it could help for some edge cases to do a deep search inside all storage objects, when it's neither a NVME or disk object

Suggested change
elif "children" in obj:
for device in obj["children"]:
if device.get("class") == "disk":
self.disks.append(
{
"logicalname": device.get("logicalname"),
"product": device.get("product"),
"serial": device.get("serial"),
"version": device.get("version"),
"size": device.get("size"),
"description": device.get("description"),
"type": device.get("description"),
}
)
elif obj.get("class") == "disk":
self.disks.append(
{
"logicalname": obj.get("logicalname"),
"product": obj.get("product"),
"serial": obj.get("serial"),
"version": obj.get("version"),
"size": obj.get("size"),
"description": obj.get("description"),
"type": obj.get("description"),
}
)
else:
for child in obj.get("children") or []:
self.find_storage(child)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants