Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: find storage #367

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

fix: find storage #367

wants to merge 2 commits into from

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.

None yet

2 participants