Skip to content

Commit

Permalink
Fixes #37230 - Remove SCA hammer references
Browse files Browse the repository at this point in the history
  • Loading branch information
chris1984 committed Mar 8, 2024
1 parent e1b107b commit 269635c
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 225 deletions.
6 changes: 0 additions & 6 deletions lib/hammer_cli_katello.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,6 @@ def self.exception_handler_class
'hammer_cli_katello/srpm'
)

HammerCLI::MainCommand.lazy_subcommand("simple-content-access",
_("Simple content access commands"),
'HammerCLIKatello::SimpleContentAccess',
'hammer_cli_katello/simple_content_access'
)

HammerCLI::MainCommand.lazy_subcommand("docker", _("Manipulate docker content"),
'HammerCLIKatello::DockerCommand',
'hammer_cli_katello/docker'
Expand Down
23 changes: 0 additions & 23 deletions lib/hammer_cli_katello/organization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class InfoCommand < HammerCLIForeman::Organization::InfoCommand
output do
field :label, _("Label")
field :description, _("Description")
field :simple_content_access_label, _("Simple Content Access")
field :service_levels, _("Service Levels"), Fields::List
from :cdn_configuration do
label "CDN configuration", hide_blank: true do
Expand All @@ -39,11 +38,6 @@ class InfoCommand < HammerCLIForeman::Organization::InfoCommand
end

def extend_data(data)
data["simple_content_access_label"] = if data["simple_content_access"]
_("Enabled")
else
_("Disabled")
end
setup_cdn_type(data)
data
end
Expand All @@ -68,23 +62,6 @@ class UpdateCommand < HammerCLIForeman::Organization::UpdateCommand
success_message _("Organization updated.")
failure_message _("Could not update the organization")

def request_params
params = super
# This is so Hammer doesn't say "Nothing to update" when toggling SCA.
# (see hammer-cli-foreman)
# Rails will safely ignore the extra parameter.
if params.key?('simple_content_access')
params["organization"] = params.fetch('organization', {}).merge(
"_simple_content_access" => params['simple_content_access'])
unless params['simple_content_access']
warn(
_("Simple Content Access will be required for all organizations in the next release.")
)
end
end
params
end

build_options do |o|
o.expand(:all).except(:environments)
end
Expand Down
59 changes: 0 additions & 59 deletions lib/hammer_cli_katello/simple_content_access.rb

This file was deleted.

14 changes: 0 additions & 14 deletions test/functional/organization/info_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,6 @@
{ "type" => 'network_sync' }
end

it "includes simple content access attributes" do
org_id = 2
params = ["--id=#{org_id}"]
api_expects(:organizations, :index).returns(index_response([{'id' => org_id}]))

api_expects(:organizations, :show)
.with_params('id' => org_id.to_s)
.returns("simple_content_access" => true, "id" => org_id,
"cdn_configuration" => cdn_configuration)
result = run_cmd(@cmd + params)
expected = success_result(FieldMatcher.new('Simple Content Access', 'Enabled'))
assert_cmd(expected, result)
end

it "includes cdn configuration attributes" do
org_id = 2
params = ["--id=#{org_id}"]
Expand Down
48 changes: 0 additions & 48 deletions test/functional/simple_content_access/disable_test.rb

This file was deleted.

46 changes: 0 additions & 46 deletions test/functional/simple_content_access/enable_test.rb

This file was deleted.

29 changes: 0 additions & 29 deletions test/functional/simple_content_access/status_test.rb

This file was deleted.

0 comments on commit 269635c

Please sign in to comment.