Skip to content

Commit

Permalink
Fixes #37948 - Update host output for MultiCV to match AK output (#964)
Browse files Browse the repository at this point in the history
* Fixes #37948 - Update host output for MultiCV to match AK output
  • Loading branch information
jeremylenz authored Nov 1, 2024
1 parent 1eaac14 commit d2c7a35
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/hammer_cli_katello/activation_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def request_params
field :format_consumed, _("Host Limit")
field :multi_content_view_environment, _("Multi Content View Environment"), Fields::Boolean
field :release_version, _("Release Version"), Fields::Field, :hide_blank => true
field :content_view_environment_labels, _("Content View Environments"), Fields::Field
field :content_view_environment_labels, _("Content View Environment Labels"), Fields::Field

collection :organization, _("Organization") do
field :id, _("Id"), Fields::Field, :hide_blank => true
Expand Down
15 changes: 8 additions & 7 deletions lib/hammer_cli_katello/host_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ module HostExtensions
::HammerCLIForeman::Host::ListCommand.instance_eval do
output do
from :content_facet_attributes do
from :content_view do
field :name, _('Content View'), Fields::List
end
from :lifecycle_environment do
field :name, _('Lifecycle environment'), Fields::List
end
field :content_view_environment_labels, _("Content View Environments"),
Fields::List, :max_width => 300
field :multi_content_view_environment,
_("Multi Content View Environment"), Fields::Boolean
from :errata_counts do
field :security, _("Security"), nil, :sets => ['ALL']
field :bugfix, _("Bugfix"), nil, :sets => ['ALL']
Expand All @@ -46,7 +44,9 @@ module HostExtensions
output do
label _('Content Information') do
from :content_facet_attributes do
collection :content_view_environments, _('Content view environments') do
field :content_view_environment_labels,
_("Content View Environment Labels"), Fields::Field
collection :content_view_environments, _('Content View Environments') do
from :content_view do
label _("Content view") do
field :id, _("Id")
Expand All @@ -60,6 +60,7 @@ module HostExtensions
field :name, _("Name")
end
end
field :label, _("Label")
end

label _("Content Source") do
Expand Down
21 changes: 21 additions & 0 deletions test/functional/host/extensions/data/host_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,27 @@
"id":1,
"name":"Library"
},
"content_view_environment_labels": "Library",
"multi_content_view_environment": false,
"content_view_environments": [
{
"content_view": {
"id": 1,
"name": "Default Organization View",
"composite": false,
"content_view_version": "1.0",
"content_view_version_id": 1,
"content_view_version_latest": true,
"content_view_default": true
},
"lifecycle_environment": {
"id": 1,
"name": "Library",
"lifecycle_environment_library": true
},
"label": "Library"
}
],
"errata_counts":{
"security":0,
"bugfix":0,
Expand Down
4 changes: 2 additions & 2 deletions test/functional/host/extensions/list_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

result = run_cmd(@cmd)

fields = ['CONTENT VIEW', 'LIFECYCLE ENVIRONMENT', 'TRACE STATUS']
values = ['Default Organization View', 'Library', 'updated']
fields = ['CONTENT VIEW ENVIRONMENTS', 'MULTI CONTENT VIEW ENVIRONMENT', 'TRACE STATUS']
values = ['Library', 'no', 'updated']
expected_result = success_result(IndexMatcher.new([fields, values]))
assert_cmd(expected_result, result)
end
Expand Down

0 comments on commit d2c7a35

Please sign in to comment.