Fixes #39414 - Show unrecognized smart proxy features in list and info#656
Fixes #39414 - Show unrecognized smart proxy features in list and info#656adamruzicka wants to merge 4 commits into
Conversation
|
Just a nit: Features:
1) Name: Dynflow
2) Name: Script
3) Name: Logs
Unrecognized features: openscapCan we unify the output? I mean either it's just a comma-separated list or "numerized lines", having both feels weird. |
Display unrecognized_features from the Foreman API response in both the list and info commands, hidden when blank. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ac1725f to
aa67933
Compare
|
Unified |
|
And now even without listing the unrecognized features twice |
| field :status, _("Status") | ||
| field :url, _("URL") | ||
| field :_features, _( "Features"), Fields::List, :hide_blank => true | ||
| field :unrecognized_features, _("Unrecognized features"), Fields::List, :hide_blank => true |
There was a problem hiding this comment.
Just for the sake of consistency (even if it's painful for the eyes)
| field :unrecognized_features, _("Unrecognized features"), Fields::List, :hide_blank => true | |
| field :_unrecognized_features, _("Unrecognized features"), Fields::List, :hide_blank => true |
| HammerCLIForeman::References.timestamps(self) | ||
| end | ||
|
|
||
| def extend_data(proxy) |
There was a problem hiding this comment.
I'd move it to the list command's extend_data and merge that:
# L19
def extend_data(proxy)
proxy['_features'] = proxy['features'].map { |f| f['name'] } if proxy['features']
proxy['_unrecognized_features'] = proxy['unrecognized_features'].map { |f| f['name'] } if proxy['unrecognized_features']
proxy
endInfo command here expects "correct" or "expected" response with features, that's why we don't have _ workaround, but for list command we do.
There was a problem hiding this comment.
For features the api returns a list of hashes, which we can use as-is in info and which we have to transform for list. For unrecognized, it is the other way around - the api gives a flat list which we can use as-is in list, but have to transform it info. That's where the asymmetry comes from. I can try messing with it a bit more, but it will probably never be as clean as we'd like
Companion to theforeman/foreman#11017
Display unrecognized_features from the Foreman API response in both the list and info commands, hidden when blank.
To be squashed on merge