Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/hammer_cli_katello/id_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ class IdResolver < HammerCLIForeman::IdResolver
include HammerCLIKatello::SearchOptionsCreators

# alias_method_chain :create_search_options, :katello_api
alias_method :create_search_options_without_katello_api, :create_search_options
alias_method :create_search_options, :create_search_options_with_katello_api
# alias_method :create_search_options_without_katello_api, :create_search_options
# alias_method :create_search_options, :create_search_options_with_katello_api
def create_search_options(options, resource, mode = nil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method can likely be removed. Calling it with super alone is just calling the parent, which means the wrapper should be unnecessary.

# Use the inherited Foreman standard method
super
end

def file_unit_id(options)
if options['option_content_view_version_version']
Expand Down
18 changes: 1 addition & 17 deletions lib/hammer_cli_katello/search_options_creators.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

module HammerCLIKatello
module SearchOptionsCreators
include HammerCLIKatello::ForemanSearchOptionsCreators

#include HammerCLIKatello::ForemanSearchOptionsCreators
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only place where HammerCLIKatello::ForemanSearchOptionsCreators is included, so perhaps the entire HammerCLIKatello::ForemanSearchOptionsCreators can be deleted.

def create_flatpak_remotes_search_options(options, _mode = nil)
name = options[HammerCLI.option_accessor_name('name')]
organization_id = options[HammerCLI.option_accessor_name("organization_id")] ||
Expand All @@ -24,21 +23,6 @@ def create_repository_sets_search_options(options, mode = nil)
)
end

def create_module_streams_search_options(options, mode = nil)
create_search_options_without_katello_api(options, api.resource(:module_streams), mode)
.merge(create_search_options(options, api.resource(:module_streams), mode))
end

def create_file_units_search_options(options, mode = nil)
create_search_options_without_katello_api(options, api.resource(:file_units), mode)
.merge(create_search_options(options, api.resource(:file_units), mode))
end

def create_content_view_filter_rules_search_options(options, mode = nil)
create_search_options_without_katello_api(
options, api.resource(:content_view_filter_rules), mode)
end

def create_repositories_search_options(options, _mode = nil)
name = options[HammerCLI.option_accessor_name("name")]
names = options[HammerCLI.option_accessor_name("names")]
Expand Down
Loading