Bug #24903
openhammer errata (and other unit types) isn't searching on name correctly
Description
Errata, package groups, and possibly other repo unit types aren't using the search param in the API call to Katello.
hammer -rd erratum info --name Duck_0.8_Erratum --repository-id 1
The API call looks like this:
[ INFO 2018-09-11T19:02:49 API] GET /katello/api/errata
[DEBUG 2018-09-11T19:02:49 API] Params: {
"name" => "Duck_0.8_Erratum"
}
[DEBUG 2018-09-11T19:02:49 API] Headers: {
:params => {
"name" => "Duck_0.8_Erratum"
}
}
[DEBUG 2018-09-11T19:02:49 API] Using authenticator: HammerCLIForeman::Api::InteractiveBasicAuth
[DEBUG 2018-09-11T19:02:49 API] Response: {
"total" => 6,
"subtotal" => 6,
"page" => 1,
"per_page" => 20,
"error" => nil,
"search" => nil,
"sort" => {
"by" => "updated",
"order" => "desc"
Notice 6 results are found, no searching has been done.
it should look like:
[ INFO 2018-09-11T19:02:49 API] GET /katello/api/errata
[DEBUG 2018-09-11T19:02:49 API] Params: {
"search" => "name = \"Duck_0.8_Erratum\""
}
This can be fixed by adding to https://github.com/Katello/hammer-cli-katello/blob/master/lib/hammer_cli_katello/foreman_search_options_creators.rb