Bug 1079587

Summary: REGRESSION: Cannot search organizations by label via CLI
Product: Red Hat Satellite Reporter: Og Maciel <omaciel>
Component: HammerAssignee: Justin Sherrill <jsherril>
Status: CLOSED CURRENTRELEASE QA Contact: Sachin Ghai <sghai>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.3CC: bkearney, jsherril, mmccune, sghai
Target Milestone: UnspecifiedKeywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/4797
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-02 14:06:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Og Maciel 2014-03-21 22:00:38 UTC
Description of problem:

Noticed that we can no longer search for an organization by label (this used to work before). Perhaps the fix for http://projects.theforeman.org/issues/4486 broke it?

2014-03-21 17:48:34 - robottelo - DEBUG - Running test TestOrg/test_redmine_4486_2_{'name': u'mEeGdLwQII'}
2014-03-21 17:48:34 - robottelo - DEBUG - >>> LANG=en_US hammer -v -u admin -p changeme  --output csv organization create --name='mEeGdLwQII'
2014-03-21 17:48:38 - robottelo - DEBUG - <<< [u'Message,Id,Name', u'Organization created,265,mEeGdLwQII', u'']
2014-03-21 17:48:38 - robottelo - DEBUG - >>> LANG=en_US hammer -v -u admin -p changeme  --output csv organization info --id='265'
2014-03-21 17:48:40 - robottelo - DEBUG - <<< [u'Id,Name,Created at,Updated at,Label,Description', u'265,mEeGdLwQII,2014/03/21 21:48:34,2014/03/21 21:48:34,mEeGdLwQII,""', u'']
2014-03-21 17:48:45 - robottelo - DEBUG - >>> LANG=en_US hammer -v -u admin -p changeme  --output csv organization list --search='label="mEeGdLwQII"'
2014-03-21 17:48:47 - robottelo - DEBUG - <<< [ERROR 2014-03-21 17:48:45 Exception] Error: 400 Bad Request
Error: 400 Bad Request
[ERROR 2014-03-21 17:48:45 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/apipie-bindings-0.0.6/lib/apipie_bindings/api.rb:196:in `send'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.6/lib/apipie_bindings/api.rb:196:in `http_call'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.6/lib/apipie_bindings/api.rb:155:in `call'
    /usr/lib/ruby/gems/1.8/gems/apipie-bindings-0.0.6/lib/apipie_bindings/resource.rb:14:in `call'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/read_command.rb:19: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_data'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/commands.rb:138:in `retrieve_and_print'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/commands.rb:125:in `browse_collection'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/commands.rb:111: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:87
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19

Version-Release number of selected component (if applicable):

* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.8.25-1.el6sam.noarch
* candlepin-scl-1-5.el6_4.noarch
* candlepin-scl-quartz-2.1.5-5.el6_4.noarch
* candlepin-scl-rhino-1.7R3-1.el6_4.noarch
* candlepin-scl-runtime-1-5.el6_4.noarch
* candlepin-selinux-0.8.25-1.el6sam.noarch
* candlepin-tomcat6-0.8.25-1.el6sam.noarch
* elasticsearch-0.90.10-4.el6sat.noarch
* foreman-1.5.0.10-1.el6sat.noarch
* foreman-compute-1.5.0.10-1.el6sat.noarch
* foreman-libvirt-1.5.0.10-1.el6sat.noarch
* foreman-postgresql-1.5.0.10-1.el6sat.noarch
* foreman-proxy-1.5.3-1.el6sat.noarch
* foreman-selinux-1.5.0-0.develop.el6sat.noarch
* katello-1.5.0-18.el6sat.noarch
* katello-apache-1.0-1.noarch
* katello-ca-1.0-1.noarch
* katello-certs-tools-1.5.5-1.el6sat.noarch
* katello-installer-0.0.30-1.el6sat.noarch
* openldap-2.4.23-31.el6.x86_64
* pulp-katello-plugins-0.2-1.el6sat.noarch
* pulp-nodes-common-2.3.1-0.4.beta.el6sat.noarch
* pulp-nodes-parent-2.3.1-0.4.beta.el6sat.noarch
* pulp-puppet-plugins-2.3.1-0.4.beta.el6sat.noarch
* pulp-rpm-plugins-2.3.1-0.4.beta.el6sat.noarch
* pulp-selinux-2.3.1-0.4.beta.el6sat.noarch
* pulp-server-2.3.1-0.4.beta.el6sat.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-ldap_fluff-0.2.2-2.el6sat.noarch
* ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch
* ruby193-rubygem-runcible-1.0.8-1.el6sat.noarch

How reproducible:


Steps to Reproduce:
1. Follow the steps mentioned above to create an org and search for it by name
2.
3.

Actual results:


Expected results:


Additional info:

Comment 4 Bryan Kearney 2014-03-26 21:26:03 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/4797 has been closed

Comment 6 Sachin Ghai 2014-05-06 08:54:34 UTC
Verified with Satellite-6.0.3-RHEL-6-20140430.4

[root@qetello02 yum.repos.d]# hammer organization create --name 'sghai123'
Organization created
[root@qetello02 yum.repos.d]# hammer organization info --name 'sghai123'
Id:                     564
Name:                   sghai123
Created at:             2014/05/06 08:39:01
Updated at:             2014/05/06 08:39:02
Label:                  sghai123
Description:            
Red Hat Repository URL: https://cdn.redhat.com

[root@qetello02 yum.repos.d]# hammer organization list --search='label="sghai123"'
----|----------|----------|------------
ID  | NAME     | LABEL    | DESCRIPTION
----|----------|----------|------------
564 | sghai123 | sghai123 |            
----|----------|----------|------------

Comment 7 Bryan Kearney 2014-07-02 14:06:08 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.