Bug 1792339 - Hammer filter create fails if default location is set.
Summary: Hammer filter create fails if default location is set.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Users & Roles
Version: 6.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.7.0
Assignee: Ondřej Pražák
QA Contact: Radovan Drazny
URL:
Whiteboard:
: 1804817 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-17 14:28 UTC by Stephen Wadeley
Modified: 2020-06-22 08:49 UTC (History)
10 users (show)

Fixed In Version: foreman-1.24.1.15-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-14 13:39:08 UTC
Target Upstream Version:
mshira: needinfo+


Attachments (Terms of Use)
Hammer output after the fix (121.81 KB, application/octet-stream)
2020-03-17 09:58 UTC, Radovan Drazny
no flags Details


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 29065 Normal Closed Hammer filter create fails if default location is set. 2020-09-10 09:51:25 UTC

Description Stephen Wadeley 2020-01-17 14:28:02 UTC
Description of problem:

In 6.7 snap 8, "hammer role create" now assigns "Default Location" by default. It does not do that in Sat6.6.1

Attempting to create a filter for a role fails with error:

Could not create the permission filter:
  Location ids You can't assign locations to this resource


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

[root@dhcp-3-165 ~]# rpm -q tfm-rubygem-hammer_cli_katello
tfm-rubygem-hammer_cli_katello-0.20.2.1-1.el7sat.noarch

[root@dhcp-3-165 ~]# rpm -q satellite
satellite-6.7.0-5.beta.el7sat.noarch
[root@dhcp-3-165 ~]# 

How reproducible:

every time

Steps to Reproduce:
[root@dhcp-3-165 ~]# hammer role create --name test

~]# hammer filter create --permissions="view_activation_keys,create_activation_keys,edit_activation_keys,destroy_activation_keys" --role-id=32
Could not create the permission filter:
  Location ids You can't assign locations to this resource
[root@dhcp-3-165 ~]# hammer role info --name test
Id:          32
Name:        test
Builtin:     no
Description: 
Locations:   
    Default Location

[root@dhcp-3-165 ~]# hammer role create --name test2
User role [test2] created.
[root@dhcp-3-165 ~]# hammer role info --name test2
Id:          33
Name:        test2
Builtin:     no
Description: 
Locations:   
    Default Location

Actual results:

Could not create the permission filter

Expected results:

hammer filter can be created


Additional info:

Bug 1778945 - Hammer filter create fails if default organization is set.

Comment 5 Tomer Brisker 2020-02-19 09:58:29 UTC
Created redmine issue https://projects.theforeman.org/issues/29065 from this bug

Comment 8 Bryan Kearney 2020-02-20 11:05:32 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/29065 has been resolved.

Comment 12 Bryan Kearney 2020-02-26 23:05:33 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/29065 has been resolved.

Comment 18 Bryan Kearney 2020-03-06 11:05:47 UTC
Upstream bug assigned to oprazak@redhat.com

Comment 19 Bryan Kearney 2020-03-06 11:05:51 UTC
Upstream bug assigned to oprazak@redhat.com

Comment 20 Bryan Kearney 2020-03-08 08:05:43 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/29065 has been resolved.

Comment 22 Radovan Drazny 2020-03-17 09:57:40 UTC
Tested on Satellite 6.7 Snap 16 (foreman-1.24.1.19-1) using the reproducer script from the original report.

./roles_permission_locations_bug.sh 
Organization created.
User role [NonAdminSubscriptionViewer] created.
Permission filter for [Organization] created.

See the attached file hammer-ok.out for the hammer debug output.

Comment 23 Radovan Drazny 2020-03-17 09:58:41 UTC
Created attachment 1670777 [details]
Hammer output after the fix

Comment 24 Bryan Kearney 2020-04-14 13:39:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:1454

Comment 25 Anand Agrawal 2020-06-22 08:49:27 UTC
*** Bug 1804817 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.