Skip to content

Commit

Permalink
Refs #36665 - Remove katello-agent end points
Browse files Browse the repository at this point in the history
  • Loading branch information
parthaa committed Aug 21, 2023
1 parent 1f29a1a commit b64de1a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 89 deletions.
13 changes: 2 additions & 11 deletions lib/hammer_cli_katello/host_errata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,11 @@ 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 " \
warn "Use the remote execution equivalent `hammer job-invocation create --feature " \
"katello_errata_install`."
super
1
end
end

Expand Down
56 changes: 8 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,42 @@ 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 " \
warn "Use the remote execution equivalent `hammer job-invocation create --feature " \
"katello_package_install`."
super
1
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 " \
warn "Use the remote execution equivalent `hammer job-invocation create --feature " \
"katello_package_update`."
super
1
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 " \
warn "Use the remote execution equivalent `hammer job-invocation create --feature " \
"katello_package_update`."
super
1
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 " \
warn "Use the remote execution equivalent is `hammer job-invocation create --feature " \
"katello_package_remove`."
super
1
end
end

Expand Down
36 changes: 6 additions & 30 deletions lib/hammer_cli_katello/host_package_group.rb
Original file line number Diff line number Diff line change
@@ -1,48 +1,24 @@
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
1
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
1
end
end

Expand Down

0 comments on commit b64de1a

Please sign in to comment.