Skip to content

Commit

Permalink
Refs #38048 - Add rolling content views
Browse files Browse the repository at this point in the history
  • Loading branch information
nadjaheitmann committed Dec 10, 2024
1 parent b45e434 commit 16e643b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/hammer_cli_katello/activation_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def request_params
field :content_view_version, _("Version")
field :content_view_version_id, _("Content View version Id")
field :composite, _("Composite"), Fields::Boolean
field :rolling, _("Rolling"), Fields::Boolean
field :content_view_environment_id, _("Content View Environment id"), Fields::Field
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/hammer_cli_katello/capsule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ class InfoCommand < HammerCLIKatello::InfoCommand
collection :content_views, _("Content Views") do
field nil, _("Name"), Fields::Reference
field :composite, _('Composite'), Fields::Boolean
field :rolling, _('Rolling'), Fields::Boolean
field :last_published, _('Last Published'), Fields::Date
collection :repositories, _('Repositories') do
field :id, _("Repository ID")
Expand Down
4 changes: 4 additions & 0 deletions lib/hammer_cli_katello/content_view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class ListCommand < HammerCLIKatello::ListCommand
field :name, _("Name")
field :label, _("Label")
field :composite, _("Composite"), Fields::Boolean
field :rolling, _("Rolling"), Fields::Boolean
field :last_published, _("Last Published"), Fields::Date, :hide_blank => true
field :repository_ids, _("Repository IDs"), Fields::List, :max_width => 300
end
Expand All @@ -32,6 +33,7 @@ class InfoCommand < HammerCLIKatello::InfoCommand
field :name, _("Name")
field :label, _("Label")
field :composite, _("Composite"), Fields::Boolean
field :rolling, _("Rolling"), Fields::Boolean
field :description, _("Description")
field :content_host_count, _("Content Host Count")
field :solve_dependencies, _("Solve Dependencies"), Fields::Boolean
Expand Down Expand Up @@ -142,11 +144,13 @@ class CreateCommand < HammerCLIKatello::CreateCommand
failure_message _("Could not create the content view")

option ["--composite"], :flag, _("Create a composite content view")
option ["--rolling"], :flag, _("Create a rolling content view")
option ["--import-only"], :flag, _("Designate this Content View for "\
"importing from upstream servers only.")
def request_params
super.tap do |opts|
opts['composite'] = option_composite? || false
opts['rolling'] = option_rolling? || false
opts['import_only'] = option_import_only? || false
end
end
Expand Down
1 change: 1 addition & 0 deletions lib/hammer_cli_katello/host_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ module HostExtensions
field :id, _("Id")
field :name, _("Name")
field :composite, _("Composite"), Fields::Boolean
field :rolling, _("Rolling"), Fields::Boolean
end
end
from :lifecycle_environment do
Expand Down
12 changes: 6 additions & 6 deletions test/functional/content_view/list_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@

ex.returns(empty_response)
expected_result = success_result(
"----------------|------|-------|-----------|----------------|---------------
CONTENT VIEW ID | NAME | LABEL | COMPOSITE | LAST PUBLISHED | REPOSITORY IDS
----------------|------|-------|-----------|----------------|---------------
"----------------|------|-------|-----------|---------|----------------|---------------
CONTENT VIEW ID | NAME | LABEL | COMPOSITE | ROLLING | LAST PUBLISHED | REPOSITORY IDS
----------------|------|-------|-----------|---------|----------------|---------------
")

result = run_cmd(@cmd + params)
Expand All @@ -57,9 +57,9 @@

ex.returns(empty_response)
expected_result = success_result(
"----------------|------|-------|-----------|----------------|---------------
CONTENT VIEW ID | NAME | LABEL | COMPOSITE | LAST PUBLISHED | REPOSITORY IDS
----------------|------|-------|-----------|----------------|---------------
"----------------|------|-------|-----------|---------|----------------|---------------
CONTENT VIEW ID | NAME | LABEL | COMPOSITE | ROLLING | LAST PUBLISHED | REPOSITORY IDS
----------------|------|-------|-----------|---------|----------------|---------------
")

result = run_cmd(@cmd + params)
Expand Down

0 comments on commit 16e643b

Please sign in to comment.