Skip to content

Commit

Permalink
Fixes #38019 - Add hammer support for flatpak remotes
Browse files Browse the repository at this point in the history
  • Loading branch information
sjha4 committed Nov 19, 2024
1 parent f96ac21 commit 42f132f
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/hammer_cli_katello.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ def self.exception_handler_class
'hammer_cli_katello/docker'
)

HammerCLI::MainCommand.lazy_subcommand!("flatpak-remote", _("Manipulate flatpak remotes"),
'HammerCLIKatello::FlatpakRemoteCommand',
'hammer_cli_katello/flatpak_remote'
)
# subcommands to hammer_cli_foreman commands
require 'hammer_cli_katello/host'
require 'hammer_cli_katello/hostgroup'
Expand Down
71 changes: 71 additions & 0 deletions lib/hammer_cli_katello/flatpak_remote.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
module HammerCLIKatello
class FlatpakRemoteCommand < HammerCLIKatello::Command

Check failure on line 2 in lib/hammer_cli_katello/flatpak_remote.rb

View workflow job for this annotation

GitHub Actions / Rubocop / Rubocop

Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
resource :flatpak_remotes

class ListCommand < HammerCLIKatello::ListCommand
include OrganizationOptions

Check failure on line 6 in lib/hammer_cli_katello/flatpak_remote.rb

View workflow job for this annotation

GitHub Actions / Rubocop / Rubocop

Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
output do

Check failure on line 7 in lib/hammer_cli_katello/flatpak_remote.rb

View workflow job for this annotation

GitHub Actions / Rubocop / Rubocop

Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
field :id, _('ID')

Check failure on line 8 in lib/hammer_cli_katello/flatpak_remote.rb

View workflow job for this annotation

GitHub Actions / Rubocop / Rubocop

Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
field :name, _('Name')
field :url, _('URL')
field :description, _('Description')
field :username, _('User')
field :token, _('Token')
field :registry_url, _('Registry URL')
end

Check failure on line 16 in lib/hammer_cli_katello/flatpak_remote.rb

View workflow job for this annotation

GitHub Actions / Rubocop / Rubocop

Layout/TrailingWhitespace: Trailing whitespace detected.
build_options

Check failure on line 17 in lib/hammer_cli_katello/flatpak_remote.rb

View workflow job for this annotation

GitHub Actions / Rubocop / Rubocop

Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
end

class InfoCommand < HammerCLIKatello::InfoCommand
output do

Check failure on line 21 in lib/hammer_cli_katello/flatpak_remote.rb

View workflow job for this annotation

GitHub Actions / Rubocop / Rubocop

Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
field :id, _('ID')

Check failure on line 22 in lib/hammer_cli_katello/flatpak_remote.rb

View workflow job for this annotation

GitHub Actions / Rubocop / Rubocop

Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
field :name, _('Name')
field :label, _('Label')
field :description, _('Description'), Fields::Field, :hide_blank => true
field :url, _('Flatpak index URL')
field :username, _('Username'), Fields::Field, :hide_blank => true
field :token, _('Token'), Fields::Field, :hide_blank => true
field :registry_url, _('Registry URL')
end

Check failure on line 31 in lib/hammer_cli_katello/flatpak_remote.rb

View workflow job for this annotation

GitHub Actions / Rubocop / Rubocop

Layout/TrailingWhitespace: Trailing whitespace detected.
build_options

Check failure on line 32 in lib/hammer_cli_katello/flatpak_remote.rb

View workflow job for this annotation

GitHub Actions / Rubocop / Rubocop

Layout/IndentationWidth: Use 2 (not 1) spaces for indentation.
end

class CreateCommand < HammerCLIKatello::CreateCommand
success_message _('Flatpak Remote created.')
failure_message _('Could not create the Flatpak Remote.')

build_options
end

class UpdateCommand < HammerCLIKatello::UpdateCommand
success_message _('Flatpak Remote updated.')
failure_message _('Could not update the Flatpak Remote.')

build_options
end

class DeleteCommand < HammerCLIKatello::DeleteCommand
success_message _('Flatpak Remote deleted.')
failure_message _('Could not delete the Flatpak Remote.')

build_options
end

class ScanCommand < HammerCLIKatello::SingleResourceCommand
include HammerCLIForemanTasks::Async

action :scan
command_name 'scan'

success_message _("Flatpak remote is being scanned in task %{id}.")
failure_message _('Could not scan the Flatpak remote')

build_options
end


autoload_subcommands
end
end

0 comments on commit 42f132f

Please sign in to comment.