From a4e8b000399297b32c9bcbb65c60b12a53fd0b9e Mon Sep 17 00:00:00 2001 From: Partha Aji Date: Mon, 21 Aug 2023 16:12:39 -0400 Subject: [PATCH] Refs #36665 - Remove katello-agent end points --- lib/hammer_cli_katello/host_errata.rb | 12 +---- lib/hammer_cli_katello/host_package.rb | 52 ++------------------ lib/hammer_cli_katello/host_package_group.rb | 34 ++----------- 3 files changed, 9 insertions(+), 89 deletions(-) diff --git a/lib/hammer_cli_katello/host_errata.rb b/lib/hammer_cli_katello/host_errata.rb index d63869fa..244afb5e 100644 --- a/lib/hammer_cli_katello/host_errata.rb +++ b/lib/hammer_cli_katello/host_errata.rb @@ -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 " \ + fail "Use the remote execution equivalent `hammer job-invocation create --feature " \ "katello_errata_install`." - super end end diff --git a/lib/hammer_cli_katello/host_package.rb b/lib/hammer_cli_katello/host_package.rb index 91e25863..81a7b3ec 100644 --- a/lib/hammer_cli_katello/host_package.rb +++ b/lib/hammer_cli_katello/host_package.rb @@ -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 " \ + fail "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 " \ + fail "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 " \ + fail "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 " \ + fail "Use the remote execution equivalent is `hammer job-invocation create --feature " \ "katello_package_remove`." - super end end diff --git a/lib/hammer_cli_katello/host_package_group.rb b/lib/hammer_cli_katello/host_package_group.rb index b24e1a80..bf9bda7e 100644 --- a/lib/hammer_cli_katello/host_package_group.rb +++ b/lib/hammer_cli_katello/host_package_group.rb @@ -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 " \ + warn "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 " \ + warn "Use the remote execution equivalent is `hammer job-invocation create --feature " \ "katello_group_remove`." - super end end