Bug #4486

Cannot search for an organization by name, only label

Added by Og Maciel over 3 years ago. Updated over 3 years ago.

Status:Closed
Priority:High
Assigned To:Tomáš Strachota
Category:API
Target version:Sprint 21
Difficulty: Bugzilla link:
Found in release: Pull request:
Story points-
Velocity based estimate-
Release1.5.0Release relationshipAuto

Description

Notice that using the CLI (and therefore the API) to search for an organization by name fails:

# hammer -v organization list --search 'name=ACME_Corporation'
[ERROR 2014-02-27 17:51:54 Exception] Error: 400 Bad Request
Error: 400 Bad Request
[ERROR 2014-02-27 17:51:54 Exception]

RestClient::BadRequest (400 Bad Request):
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/abstract_response.rb:48:in `return!'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:220:in `process_result'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:169:in `transmit'
    /usr/lib/ruby/1.8/net/http.rb:543:in `start'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:166:in `transmit'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:60:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:31:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/resource.rb:54:in `get'
    /usr/lib/ruby/gems/1.8/gems/katello_api-0.0.8/lib/katello_api/base.rb:70:in `send'
    /usr/lib/ruby/gems/1.8/gems/katello_api-0.0.8/lib/katello_api/base.rb:70:in `http_call'
    /usr/lib/ruby/gems/1.8/gems/katello_api-0.0.8/lib/katello_api/base.rb:51:in `perform_call'
    /usr/lib/ruby/gems/1.8/gems/katello_api-0.0.8/lib/katello_api/resources/organization.rb:22:in `index'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/resource.rb:53:in `send'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/resource.rb:53:in `call'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/read_command.rb:17:in `retrieve_data'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/commands.rb:48:in `retrieve_data'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/commands.rb:93:in `retrieve_and_print'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/commands.rb:68:in `execute'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/resource_supported_test.rb:9:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/bin/hammer:61
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19

Logs show:

Started GET "/katello/api/organizations" for 127.0.0.1 at 2014-02-27 17:51:54 -0500
Processing by Katello::Api::V2::OrganizationsController#index as JSON
  Parameters: {"api_version"=>"v2", "organization"=>{}}
Authorized user admin(Admin User)
  Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-1.5.0/app/views/katello/api/v2/organizations/index.json.rabl within api/v2/layouts/index_layout (7.3ms)
Completed 200 OK in 73ms (Views: 8.8ms | ActiveRecord: 14.5ms)

Started GET "/katello/api/organizations?sort=&search=name%3DACME_Corporation" for 127.0.0.1 at 2014-02-27 17:51:54 -0500
Processing by Katello::Api::V2::OrganizationsController#index as JSON
  Parameters: {"sort"=>"", "search"=>"name=ACME_Corporation", "api_version"=>"v2", "organization"=>{}}
Authorized user admin(Admin User)
Field 'name' not recognized for searching! (ScopedSearch::QueryNotSupported)
  Rendered api/v2/errors/param_error.json.rabl within api/v2/layouts/error_layout (0.6ms)
Completed 400 Bad Request in 58ms (Views: 1.5ms | ActiveRecord: 13.9ms)

This severely affects automation.


Related issues

Related to Foreman - Bug #4443: Auto-completion of organization search fails as sort colu... Closed 02/25/2014
Related to Foreman - Refactor #4613: Remove duplicate scoped search definition from taxonomy m... Closed 03/10/2014

Associated revisions

Revision ca276237
Added by Tomas Strachota over 3 years ago

Fixes #4486 - organization not searchable by name

History

#1 Updated by Dominic Cleal over 3 years ago

  • Related to Bug #4443: Auto-completion of organization search fails as sort column is not in result set added

#2 Updated by Tomáš Strachota over 3 years ago

  • Status changed from New to Assigned
  • Assigned To set to Tomáš Strachota
  • Target version set to Sprint 21

It makes a lot of cli commands dis-functional. I'm adding this to the sprint.

#3 Updated by Tomáš Strachota over 3 years ago

  • Related to deleted (Bug #4443: Auto-completion of organization search fails as sort column is not in result set)

#4 Updated by Tomáš Strachota over 3 years ago

  • Duplicated by Bug #4443: Auto-completion of organization search fails as sort column is not in result set added

#5 Updated by Tomáš Strachota over 3 years ago

  • Status changed from Assigned to Ready For Testing

#6 Updated by Tomáš Strachota over 3 years ago

  • Duplicated by deleted (Bug #4443: Auto-completion of organization search fails as sort column is not in result set)

#7 Updated by Tomáš Strachota over 3 years ago

  • Related to Bug #4443: Auto-completion of organization search fails as sort column is not in result set added

#8 Updated by Tomáš Strachota over 3 years ago

  • Related to Refactor #4613: Remove duplicate scoped search definition from taxonomy models added

#9 Updated by Og Maciel over 3 years ago

Environment:

  • apr-util-ldap-1.3.9-3.el6_0.1.x86_64
  • candlepin-0.8.33-1.el6.noarch
  • candlepin-selinux-0.8.33-1.el6.noarch
  • candlepin-tomcat6-0.8.33-1.el6.noarch
  • elasticsearch-0.90.10-4.el6.noarch
  • foreman-1.5.0-0.develop.201403071828gite4d8817.el6.noarch
  • foreman-postgresql-1.5.0-0.develop.201403071828gite4d8817.el6.noarch
  • foreman-proxy-1.5.0-0.develop.201402201704gita25e7b9.el6.noarch
  • foreman-release-1.5.0-0.develop.201403071828gite4d8817.el6.noarch
  • foreman-selinux-1.5.0-0.develop.201402261344git2f43f94.el6.noarch
  • katello-1.5.0-14.201403071827git0bda7f5.el6.noarch
  • katello-apache-1.0-1.noarch
  • katello-ca-1.0-1.noarch
  • katello-certs-tools-1.5.2-1.el6.noarch
  • katello-installer-0.0.19-1.201403072013gita7ceec1.el6.noarch
  • katello-repos-1.5.1-1.git.14.0868bd1.el6.noarch
  • openldap-2.4.23-31.el6.x86_64
  • pulp-katello-plugins-0.2-1.el6.noarch
  • pulp-nodes-common-2.3.1-1.el6.noarch
  • pulp-nodes-parent-2.3.1-1.el6.noarch
  • pulp-puppet-plugins-2.3.1-1.el6.noarch
  • pulp-rpm-plugins-2.3.1-1.el6.noarch
  • pulp-selinux-2.3.1-1.el6.noarch
  • pulp-server-2.3.1-1.el6.noarch
  • python-ldap-2.3.10-1.el6.x86_64
  • ruby193-rubygem-ldap_fluff-0.2.2-2.el6.noarch
  • ruby193-rubygem-net-ldap-0.3.1-1.el6.noarch
  • ruby193-rubygem-runcible-1.0.8-1.el6.noarch
robottelo: DEBUG: >>> LANG=en_US hammer -v -u admin -p changeme --output csv organization create --name='nqvEHbLSum'
robottelo: DEBUG: <<< ['Message,Id,Name', 'Organization created,119,nqvEHbLSum', '']
robottelo: DEBUG: >>> LANG=en_US hammer -v -u admin -p changeme --output csv organization info --id='119'
robottelo: DEBUG: <<< ['Id,Name,Created at,Updated at,Label,Description', '119,nqvEHbLSum,2014/03/11 14:47:38,2014/03/11 14:47:39,nqvEHbLSum,""', '']
robottelo: DEBUG: >>> LANG=en_US hammer -v -u admin -p changeme --output csv organization list --search='name="nqvEHbLSum"'
robottelo: DEBUG: <<< [ERROR 2014-03-11 10:47:48 Exception] Error: 400 Bad Request
Error: 400 Bad Request
[ERROR 2014-03-11 10:47:48 Exception]

RestClient::BadRequest (400 Bad Request):
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/abstract_response.rb:48:in `return!'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:220:in `process_result'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:169:in `transmit'
    /usr/lib/ruby/1.8/net/http.rb:543:in `start'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:166:in `transmit'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:60:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:31:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/resource.rb:54:in `get'
    /usr/lib/ruby/gems/1.8/gems/katello_api-0.0.8/lib/katello_api/base.rb:70:in `send'
    /usr/lib/ruby/gems/1.8/gems/katello_api-0.0.8/lib/katello_api/base.rb:70:in `http_call'
    /usr/lib/ruby/gems/1.8/gems/katello_api-0.0.8/lib/katello_api/base.rb:51:in `perform_call'
    /usr/lib/ruby/gems/1.8/gems/katello_api-0.0.8/lib/katello_api/resources/organization.rb:22:in `index'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/resource.rb:53:in `send'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/resource.rb:53:in `call'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/read_command.rb:17:in `retrieve_data'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/commands.rb:48:in `retrieve_data'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/commands.rb:93:in `retrieve_and_print'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/commands.rb:68:in `execute'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/resource_supported_test.rb:9:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/bin/hammer:61
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19

#10 Updated by Og Maciel over 3 years ago

  • Status changed from Ready For Testing to Rejected

Rejected by QE.

#11 Updated by Dominic Cleal over 3 years ago

  • Status changed from Rejected to Ready For Testing

This hasn't been merged - please don't close tickets.

#12 Updated by Dominic Cleal over 3 years ago

  • Release set to 1.5.0

#13 Updated by Anonymous over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF