kontron / python-ipmi

A pure python IPMI library
GNU Lesser General Public License v2.1
185 stars 74 forks source link

Add cmd error code descr #155

Closed canteuni closed 1 year ago

canteuni commented 1 year ago

This PR aims to add some command-specific completion code descriptions.

Some descriptions were already written but never used, so I add the corresponding dictionary to the CompletionCodeError implementation. This dictionary also needs the corresponding command ID in order to find the description so I add a reference to the command ID in places where check_completion_code is called and where I'm sure the specific CC descriptions exist for this command.

coveralls commented 1 year ago

Coverage Status

coverage: 69.362% (+0.05%) from 69.315% when pulling 17decdba222e816febb290a1eae205dbe596ddb5 on canteuni:add_cmd_error_code_descr into 218f14124eb82d7834d18d94a49f9e2fb45cbee3 on kontron:master.

hthiery commented 1 year ago

Hi, very good idea.

But I think it is not thought far enough. We have to take into account that there are netfn and group ids which have commands with the same id and have to be distinguished between them.

Have a look here: https://github.com/kontron/python-ipmi/blob/master/pyipmi/msgs/registry.py#L48C8-L48C73

what do you think

canteuni commented 1 year ago

Oh you're right, I thought that the command id was globally unique but that's not the case. Then I must use a tuple (netfn, cmdid, group_extension) as identifier, I'll make the changes

hthiery commented 1 year ago

Looks good to me. Thank you!