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

Power Supply, Fan: Look at PrettyName #1125

Open
wants to merge 1 commit into
base: 1110
Choose a base branch
from

Conversation

gtmills
Copy link
Contributor

@gtmills gtmills commented Jan 14, 2025

Use getPrettyName like we do for Processors, Assembly, Chassis, Storage, Memory.

#542 (1050/1060) #918 (1110) added PrettyName for Processors, Assembly, Chassis, Storage but not PowerSupplies/Fan. I believe this was due to not needed at the time. #1111 added PrettyName for Dimm.

Fixes 668395

No upstream here, https://jsw.ibm.com/browse/PFEBMC-2871 tracks getting prettyname upstream

Tested:
Before
"Name": "Power Supply",
and
"Name": "Fan",

After:
"Name": "powersupply0",
and
"Name": "fan1",

Use getPrettyName like we do for Processors, Assembly, Chassis, Storage,
Memory.

Signed-off-by: Gunnar Mills <[email protected]>
Copy link

@jinuthomas jinuthomas left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jeaaustx jeaaustx left a comment

Choose a reason for hiding this comment

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

I have one comment on how I think this would have to be done upstream. But looks okay to me for 1110.

@@ -349,6 +349,9 @@ inline void
getFanAsset(asyncResp, fanPath, service);
getFanLocation(asyncResp, fanPath, service);
getLocationIndicatorActive(asyncResp, fanPath);
const dbus::utility::MapperServiceMap& serviceMatch = {{service, {""}}};
Copy link
Contributor

Choose a reason for hiding this comment

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

I see that this will work, but it does with the understanding that getPrettyName() only uses the first element of the first pair.

For upstream it seems like handleFanPath() would need to be altered to pass the object to the callback function. Then the callback function would pull the fanPath for those related functions and pass the object to getPrettyName(). (Could also leave the setting of Name in addFanCommonProperties() if the object is passed on to it.

This is probably more change than we want in 1110?

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.

4 participants