Project

General

Profile

Actions

Bug #25027

closed

Filtering of some entities does not work

Added by Christine Fouant about 6 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Hammer
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1584785

Description of problem:
Some entities can only be specified using --<entity>-id because when specified by name by --<entity>, search doesn't query for the name entered and returns multiple results. I discovered this for images and compute resources.

By using 'hammer -d', I discovered the correct request and response (for the entity which works) are:

[DEBUG 2018-05-31T12:08:08 API] Headers: {
:params => {
:search => "name = \"Kickstart default\""
}
}
[DEBUG 2018-05-31T12:08:08 API] Response: {
"total" => 14,
"subtotal" => 1,
"page" => 1,
"per_page" => 20,
"search" => "name = \"Kickstart default\"",
"sort" => {
"by" => nil,
"order" => nil
},
...

Notice the request is in form ':search => "name = \"Kickstart default\""' and response shows non-nil 'search' param.
And the incorrect ones are:

[DEBUG 2018-05-31T12:08:08 API] Headers: {
:params => {
"compute_resource_id" => 1,
"operatingsystem_id" => 1,
"name" => "fish"
}
}
[DEBUG 2018-05-31T12:08:09 API] Response: {
"total" => 2,
"subtotal" => 2,
"page" => 1,
"per_page" => 20,
"search" => nil,
"sort" => {
"by" => nil,
"order" => nil
},
...
Notice the request is wrongly in form '"name" => "fish"' and 'search' in response is nil.

Version-Release number of selected component (if applicable):
Tested on Sat 6.4 snap 5

How reproducible:
Deterministic

Steps to Reproduce:
  1. hammer host create --compute-resource-id 1 ...

Actual results:
Could not create the host:
Error: Found more than one image.

Expected results:
Same as specifying the entity (compute resource in this case) by id

Additional info:


Related issues 2 (1 open1 closed)

Related to Katello - Refactor #26027: hammer_cli_katello resolvers interfere with foreman onces on katello-extended resourcesNewChristine FouantActions
Copied from Katello - Bug #23993: Filtering of some entities does not workClosedChristine FouantActions
Actions #1

Updated by Christine Fouant about 6 years ago

  • Copied from Bug #23993: Filtering of some entities does not work added
Actions #2

Updated by The Foreman Bot about 6 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/hammer-cli-katello/pull/590 added
Actions #3

Updated by Christine Fouant about 6 years ago

  • Status changed from Ready For Testing to Closed
Actions #4

Updated by Jonathon Turel about 6 years ago

  • Pull request deleted (https://github.com/Katello/hammer-cli-katello/pull/574)
Actions #5

Updated by Jonathon Turel about 6 years ago

  • Target version changed from Katello 3.7.1 to Katello 3.9.0
Actions #6

Updated by Ivan Necas almost 6 years ago

  • Related to Refactor #26027: hammer_cli_katello resolvers interfere with foreman onces on katello-extended resources added
Actions

Also available in: Atom PDF