Bug 1138559

Summary: Hammer Cli role list filters does not work if 'name' is provided
Product: Red Hat Satellite Reporter: Tazim Kolhar <tkolhar>
Component: HammerAssignee: Martin Bacovsky <mbacovsk>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: bbuckingham, bkearney, cwelton, dcleal, nshaik
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
URL: http://projects.theforeman.org/issues/7411
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-03 13:23: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 Tazim Kolhar 2014-09-05 07:47:36 UTC
Description of problem:
role list filters does not work if 'name' is provided

Version-Release number of selected component (if applicable):
foreman-gce-1.6.0.44-1.el7sat.noarch
rubygem-hammer_cli_foreman-0.1.1-16.el7sat.noarch
foreman-selinux-1.6.0.14-1.el7sat.noarch
ruby193-rubygem-foreman_hooks-0.3.5-2.el7sat.noarch
ruby193-rubygem-foreman_discovery-1.3.0-2.el7sat.noarch
foreman-ovirt-1.6.0.44-1.el7sat.noarch
ruby193-rubygem-foreman-redhat_access-0.0.4-2.el7sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3-3.el7sat.noarch
qe-sat6-rhel7.usersys.redhat.com-foreman-client-1.0-1.noarch
foreman-compute-1.6.0.44-1.el7sat.noarch
ruby193-rubygem-foreman-tasks-0.6.9-1.1.el7sat.noarch
ruby193-rubygem-foreman_bootdisk-2.0.5-2.el7sat.noarch
foreman-libvirt-1.6.0.44-1.el7sat.noarch
foreman-proxy-1.6.0.30-1.el7sat.noarch
foreman-1.6.0.44-1.el7sat.noarch
foreman-vmware-1.6.0.44-1.el7sat.noarch
foreman-postgresql-1.6.0.44-1.el7sat.noarch
qe-sat6-rhel7.usersys.redhat.com-foreman-proxy-1.0-1.noarch


How reproducible:
everytime

Steps to Reproduce:
1.# hammer role filters --name testrole
[Foreman] username: admin
[Foreman] password for admin: 
Error: Missing options to search filter

2.# hammer role filters --id 41
[Foreman] username: admin
[Foreman] password for admin: 
----|---------------|--------|------------|----------|----------------------
ID  | RESOURCE TYPE | SEARCH | UNLIMITED? | ROLE     | PERMISSIONS          
----|---------------|--------|------------|----------|----------------------
121 | Architecture  | none   | yes        | testrole | destroy_architectures
----|---------------|--------|------------|----------|----------------------

3.

Actual results:
roles list filter fails if name is provided
it works if we use 'id' instead of name

Expected results:
roles list filter should work in both cases (id and name)

Additional info:

Comment 1 RHEL Program Management 2014-09-05 08:03:03 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 4 Dominic Cleal 2014-09-11 13:42:38 UTC
Created redmine issue http://projects.theforeman.org/issues/7411 from this bug

Comment 8 Martin Bacovsky 2016-08-03 13:23:08 UTC
This bug was fixed in foreman 1.7 and probably in Satellite 6.1.

# hammer role filters --name Viewer
[Foreman] Password for admin: 
---|--------------------|--------|------------|--------|---------------------------------------------------------------------------------
ID | RESOURCE TYPE      | SEARCH | UNLIMITED? | ROLE   | PERMISSIONS                                                                     
---|--------------------|--------|------------|--------|---------------------------------------------------------------------------------
42 | Architecture       | none   | yes        | Viewer | view_architectures                                                              
43 | Audit              | none   | yes        | Viewer | view_audit_logs                                                                 
44 | AuthSourceLdap     | none   | yes        | Viewer | view_authenticators                                                             
45 | Bookmark           | none   | yes        | Viewer | view_bookmarks                                                                  
46 | CommonParameter    | none   | yes        | Viewer | view_globals                                                                    
47 | ComputeProfile     | none   | yes        | Viewer | view_compute_profiles                                                           
48 | ComputeResource    | none   | yes        | Viewer | view_compute_resources, view_compute_resources_vms                              
49 | ConfigGroup        | none   | yes        | Viewer | view_config_groups                                                              
50 | (Miscellaneous)    | none   | yes        | Viewer | access_dashboard, view_plugins, access_settings, view_statistics, view_tasks,...
51 | Domain             | none   | yes        | Viewer | view_domains                                                                    
52 | Environment        | none   | yes        | Viewer | view_environments                                                               
53 | ExternalUsergroups | none   | yes        | Viewer | view_external_usergroups                                                        
54 | FactValue          | none   | yes        | Viewer | view_facts                                                                      
55 | Filter             | none   | yes        | Viewer | view_filters                                                                    
56 | Hostgroup          | none   | yes        | Viewer | view_hostgroups                                                                 
57 | Host               | none   | yes        | Viewer | view_hosts                                                                      
58 | Image              | none   | yes        | Viewer | view_images                                                                     
59 | Location           | none   | yes        | Viewer | view_locations                                                                  
60 | LookupKey          | none   | yes        | Viewer | view_external_variables                                                         
61 | MailNotification   | none   | yes        | Viewer | view_mail_notifications                                                         
---|--------------------|--------|------------|--------|---------------------------------------------------------------------------------
Page 1 of 3 (use --page and --per-page for navigation)

Tested on Sat 6.2
# rpm -q satellite foreman
satellite-6.2.0-21.1.el7sat.noarch
foreman-1.11.0.49-1.el7sat.noarch


Cloasing as CURRENTRELEASE