-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fixes #634: Added value-mapped string to properties in instance table output #636
Conversation
2da7adc
to
885c981
Compare
885c981
to
09e8bb0
Compare
On your discussion points I would say:
|
09e8bb0
to
c93cabd
Compare
@FarmerMike252 In your answer to the second question, did you actually mean to say "JUST SILENTLY NOT SHOW VALUEMAP"? If so, then the PR that is up is in tune with your answers (although I would say we should test against SFCB to be really sure) |
I was thinking of just the values rather than values and maps. with option to show the maps or maps and values. I don't have strong reason however since this is all new |
I am fine with just showing the value/valuemap pair. However, my testing shows that it only works sometimes. It worked on CIM_RegisteredProfile instances, but when I tested it on CIM_ComputerSystem the translation was only done on EnabledState.
|
Andy, yes I meant "JUST SILENTLY NOT SHOW VALUEMAP". However, look at my previous comment. I don't understand why we are not getting the output on Dedicated and OperationalStatus. |
I'll look into it. It is definitely not intended :-) The |
It turns out that The reason this did not fail with the array properties, is that in my use of it in pywbemtools, I was unintendedly consistent with that, by using a type check that did not match for arrays: https://github.com/pywbem/pywbemtools/blob/andy/valuemap/pywbemtools/pywbemcli/_common.py#L1469 The action is to add support for array elements to I have created pywbem issues:
|
c93cabd
to
c90ae8a
Compare
c90ae8a
to
85a5d33
Compare
It turned out that As a result, this PR now works for both scalar-typed and array-typed properties, for all supported versions of pywbem:
@FarmerMike252: Mike, please retry your test with this updated pywbemtools branch. The pywbem version does not matter (as long as it is supported by this version of pywbemtools, i.e. pywbem 0.17.0 or higher). |
85a5d33
to
63abeec
Compare
63abeec
to
b932026
Compare
b932026
to
b8b4e27
Compare
6436c20
to
41fcf7e
Compare
Details: * For integer-typed (scalar or array) properties that have a ValueMap qualifier, the output of instances in table format now includes the value of the Values qualifier in parenthesis, in addition to the integer value. (See issue #634) This change does not depend on the recent improvements of the ValueMapping support in pywbem versions 0.17.3 and 1.0.0b2 (See pywbem issue #2304), because the improvement only added support for passing a list or tuple of element values to ValueMapping.tovalues(), and because this change processes one value at a time, this new ability of the pywbem method is not used in pywbemcli. * Added testcases for array properties. * Added a TODO for an error that causes properties to be missed in instance table output. See issue #650. Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
41fcf7e
to
e35fdab
Compare
Merged it. Karl agrees that for now, we won't add options to enable or disable the behavior. If there are issues with this change, or requests for new functionality around it, please open a new issue. |
Update: For latest status, see the last comments of this PR
Ready for initial use and review.
The use of valuemap/values is always enabled when displaying instances in a table format and when the WBEM server supports class operations, so there is no option to enable or disable it.
The properties that are integer-typed and that have a valuemapping defined or inherited in the creation class of the instance are displayed with the Values value in parenthesis after the integer value.
Example with the changes from this PR, that added a "gender" property with value-mapped values for male and female:
Discussion points:
Mike has provided his views on these discussion points further down.
Limitation: This PR limits the support to scalar elements. Array elements are displayed as normal, i.e. without the value-mapped value in parenthesis.