Skip to content

Commit

Permalink
Refs #36665 - Remove katello-agent end points
Browse files Browse the repository at this point in the history
Update lib/hammer_cli_katello/host_package_group.rb

Co-authored-by: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
  • Loading branch information
parthaa and ekohl committed Aug 22, 2023
1 parent 1f29a1a commit c8d6881
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 89 deletions.
12 changes: 1 addition & 11 deletions lib/hammer_cli_katello/host_errata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,10 @@ class HostErrata < HammerCLIKatello::Command
desc "Manage errata on your hosts"

class ApplyCommand < HammerCLIKatello::SingleResourceCommand
include HammerCLIForemanTasks::Async
resource :host_errata, :apply
command_name "apply"
success_message _("Errata is being applied with task %{id}.")
failure_message _("Could not apply errata")

build_options(without: ['ids'])

def execute
warn "This command uses katello agent and will be removed in favor of remote execution " \
"in Katello 4.10."
warn "The remote execution equivalent is `hammer job-invocation create --feature " \
raise "Use the remote execution equivalent `hammer job-invocation create --feature " \
"katello_errata_install`."
super
end
end

Expand Down
52 changes: 4 additions & 48 deletions lib/hammer_cli_katello/host_package.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,82 +13,38 @@ class ListCommand < HammerCLIKatello::ListCommand
end

class InstallCommand < HammerCLIKatello::SingleResourceCommand
include HammerCLIForemanTasks::Async
resource :host_packages, :install
command_name "install"
success_message "Packages install successfully."
failure_message "Could not install packages"

validate_options do
option(:option_packages).required
end

build_options :without => [:groups]

def execute
warn "This command uses katello agent and will be removed in favor of remote execution " \
"in Katello 4.10."
warn "The remote execution equivalent is `hammer job-invocation create --feature " \
raise "Use the remote execution equivalent `hammer job-invocation create --feature " \
"katello_package_install`."
super
end
end

class UpgradeCommand < HammerCLIKatello::SingleResourceCommand
include HammerCLIForemanTasks::Async
resource :host_packages, :upgrade
command_name "upgrade"
success_message "Packages upgraded successfully."
failure_message "Could not upgrade packages"

build_options

def execute
warn "This command uses katello agent and will be removed in favor of remote execution " \
"in Katello 4.10."
warn "The remote execution equivalent is `hammer job-invocation create --feature " \
raise "Use the remote execution equivalent `hammer job-invocation create --feature " \
"katello_package_update`."
super
end
end

class UpgradeAllCommand < HammerCLIKatello::SingleResourceCommand
include HammerCLIForemanTasks::Async
resource :host_packages, :upgrade_all
command_name "upgrade-all"
success_message "All packages upgraded successfully."
failure_message "Could not upgrade all packages"

build_options

def execute
warn "This command uses katello agent and will be removed in favor of remote execution " \
"in Katello 4.10."
warn "The remote execution equivalent is `hammer job-invocation create --feature " \
raise "Use the remote execution equivalent `hammer job-invocation create --feature " \
"katello_package_update`."
super
end
end

class RemoveCommand < HammerCLIKatello::SingleResourceCommand
include HammerCLIForemanTasks::Async
resource :host_packages, :remove
command_name "remove"
success_message "Packages removed successfully."
failure_message "Could not remove packages"

validate_options do
option(:option_packages).required
end

build_options :without => [:groups]

def execute
warn "This command uses katello agent and will be removed in favor of remote execution " \
"in Katello 4.10."
warn "The remote execution equivalent is `hammer job-invocation create --feature " \
raise "Use the remote execution equivalent is `hammer job-invocation create --feature " \
"katello_package_remove`."
super
end
end

Expand Down
34 changes: 4 additions & 30 deletions lib/hammer_cli_katello/host_package_group.rb
Original file line number Diff line number Diff line change
@@ -1,48 +1,22 @@
module HammerCLIKatello
class HostPackageGroup < HammerCLIKatello::Command
desc "Manage package-groups on your hosts"
desc "Manage package-groups on your hosts. Note these command are no longer available"\
"\n Use the remote execution equivalent"

class InstallCommand < HammerCLIKatello::SingleResourceCommand
include HammerCLIForemanTasks::Async
resource :host_packages, :install
command_name "install"
success_message "Package-groups installed successfully."
failure_message "Could not install package-groups"

validate_options do
option(:option_groups).required
end

build_options :without => [:packages]

def execute
warn "This command uses katello agent and will be removed in favor of remote execution " \
"in Katello 4.10."
warn "The remote execution equivalent is `hammer job-invocation create --feature " \
raise "Use the remote execution equivalent `hammer job-invocation create --feature " \
"katello_group_install`."
super
end
end

class RemoveCommand < HammerCLIKatello::SingleResourceCommand
include HammerCLIForemanTasks::Async
resource :host_packages, :remove
command_name "remove"
success_message "Package-groups removed successfully."
failure_message "Could not remove package-groups"

validate_options do
option(:option_groups).required
end

build_options :without => [:packages]

def execute
warn "This command uses katello agent and will be removed in favor of remote execution " \
"in Katello 4.10."
warn "The remote execution equivalent is `hammer job-invocation create --feature " \
raise "Use the remote execution equivalent is `hammer job-invocation create --feature " \
"katello_group_remove`."
super
end
end

Expand Down

0 comments on commit c8d6881

Please sign in to comment.