Skip to content

Commit 2012259

Browse files
committed
Fixes #14307 - Change katello id resolver to not use 'name' parameters
* Delete override to allow katello api to use search: {name: 'foo'} * Now katello api use search from Foreman super class
1 parent 9e331f8 commit 2012259

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

lib/hammer_cli_katello/id_resolver.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,12 @@ class IdResolver < HammerCLIForeman::IdResolver
4848
include HammerCLIKatello::SearchOptionsCreators
4949

5050
# alias_method_chain :create_search_options, :katello_api
51-
alias_method :create_search_options_without_katello_api, :create_search_options
52-
alias_method :create_search_options, :create_search_options_with_katello_api
51+
# alias_method :create_search_options_without_katello_api, :create_search_options
52+
# alias_method :create_search_options, :create_search_options_with_katello_api
53+
def create_search_options(options, resource, mode = nil)
54+
# Use the inherited Foreman standard method
55+
super
56+
end
5357

5458
def file_unit_id(options)
5559
if options['option_content_view_version_version']

lib/hammer_cli_katello/search_options_creators.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
module HammerCLIKatello
44
module SearchOptionsCreators
55
include HammerCLIKatello::ForemanSearchOptionsCreators
6-
76
def create_flatpak_remotes_search_options(options, _mode = nil)
87
name = options[HammerCLI.option_accessor_name('name')]
98
organization_id = options[HammerCLI.option_accessor_name("organization_id")] ||
@@ -24,21 +23,6 @@ def create_repository_sets_search_options(options, mode = nil)
2423
)
2524
end
2625

27-
def create_module_streams_search_options(options, mode = nil)
28-
create_search_options_without_katello_api(options, api.resource(:module_streams), mode)
29-
.merge(create_search_options(options, api.resource(:module_streams), mode))
30-
end
31-
32-
def create_file_units_search_options(options, mode = nil)
33-
create_search_options_without_katello_api(options, api.resource(:file_units), mode)
34-
.merge(create_search_options(options, api.resource(:file_units), mode))
35-
end
36-
37-
def create_content_view_filter_rules_search_options(options, mode = nil)
38-
create_search_options_without_katello_api(
39-
options, api.resource(:content_view_filter_rules), mode)
40-
end
41-
4226
def create_repositories_search_options(options, _mode = nil)
4327
name = options[HammerCLI.option_accessor_name("name")]
4428
names = options[HammerCLI.option_accessor_name("names")]

0 commit comments

Comments
 (0)