Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1486227 - Taxonomies of role filter are not updating through Hammer CLI
Summary: Taxonomies of role filter are not updating through Hammer CLI
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Users & Roles
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks: 1373844
TreeView+ depends on / blocked
 
Reported: 2017-08-29 09:14 UTC by Jitendra Yejare
Modified: 2019-09-26 14:04 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:32:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 20817 0 None None None 2017-08-31 12:04:48 UTC
Red Hat Bugzilla 1401469 0 low CLOSED hammer filter info does not return organizations and locations 2021-02-22 00:41:40 UTC

Internal Links: 1401469

Description Jitendra Yejare 2017-08-29 09:14:42 UTC
Description of problem:
Updating role to override the "filter with taxonomies" is broken. Taxonomies are not getting assigned to overridden filter.

Version-Release number of selected component (if applicable):
Satellite 6.2 Snap 13

How reproducible:
Always

Steps to Reproduce:
1. Create Role
2. Add filter(overridden/non-overridden) to the above role 
3.  From hammer CLI, attempt to update filter (with/without override flag and) assign some taxonomies

Commands:
#hammer filter update --id 493 --role-id 42 --override yes --organization-ids "1,3" --location-ids "2,4"
-> Permission filter for [Subnet] updated

Actual results:
1. The filter is set to overridden which is expected
2. Taxonomies of role filters are not updated

Expected results:
Taxonomies of role filter should be updated

Note:
This but is reproducible in both the cases when updating filter which is "not overridden or already overriden".

Logs:
/var/log/foreman/production.log:

2017-08-29 04:41:16 1eaba8c3 [app] [I] Started GET "/api/filters/493" for 10.16.4.58 at 2017-08-29 04:41:16 -0400
2017-08-29 04:41:16 1eaba8c3 [app] [I] Processing by Api::V2::FiltersController#show as JSON
2017-08-29 04:41:16 1eaba8c3 [app] [I]   Parameters: {"apiv"=>"v2", "id"=>"493", "filter"=>{}}
2017-08-29 04:41:16 1eaba8c3 [app] [I] Current user: foreman_admin (administrator)
2017-08-29 04:41:16 1eaba8c3 [app] [I] Current user: foreman_admin (administrator)
2017-08-29 04:41:16 1eaba8c3 [app] [I] Current user: admin (administrator)
2017-08-29 04:41:16 1eaba8c3 [app] [I] Authorized user admin(Admin User)
2017-08-29 04:41:16 1eaba8c3 [app] [I] Current user: admin (administrator)
2017-08-29 04:41:16 1eaba8c3 [app] [I]   Rendered api/v2/filters/show.json.rabl (11.7ms)
2017-08-29 04:41:16 1eaba8c3 [app] [I] Completed 200 OK in 46ms (Views: 11.4ms | ActiveRecord: 20.8ms)
2017-08-29 04:41:16 93e37b81 [app] [I] Started PUT "/api/filters/493" for 10.16.4.58 at 2017-08-29 04:41:16 -0400
2017-08-29 04:41:16 93e37b81 [app] [I] Processing by Api::V2::FiltersController#update as JSON
2017-08-29 04:41:16 93e37b81 [app] [I]   Parameters: {"filter"=>{"role_id"=>42, "organization_ids"=>[], "location_ids"=>[]}, "apiv"=>"v2", "id"=>"493"}
2017-08-29 04:41:16 93e37b81 [app] [I] Current user: foreman_admin (administrator)
2017-08-29 04:41:16 93e37b81 [app] [I] Current user: foreman_admin (administrator)
2017-08-29 04:41:16 93e37b81 [app] [I] Current user: admin (administrator)
2017-08-29 04:41:16 93e37b81 [app] [I] Authorized user admin(Admin User)
2017-08-29 04:41:16 93e37b81 [app] [I] Current user: admin (administrator)
2017-08-29 04:41:16 93e37b81 [app] [I]   Rendered api/v2/filters/update.json.rabl (5.6ms)
2017-08-29 04:41:16 93e37b81 [app] [I] Completed 200 OK in 48ms (Views: 6.3ms | ActiveRecord: 10.3ms)
2017-08-29 04:41:17 eb5c0b42 [app] [I] Started GET "/notification_recipients" for 10.76.33.235 at 2017-08-29 04:41:17 -0400
2017-08-29 04:41:17 eb5c0b42 [app] [I] Processing by NotificationRecipientsController#index as JSON
2017-08-29 04:41:17 eb5c0b42 [app] [I] Current user: admin (administrator)
2017-08-29 04:41:17 eb5c0b42 [app] [I] Completed 200 OK in 4ms (Views: 0.1ms | ActiveRecord: 0.7ms)
2017-08-29 04:41:27 9d7a7ee1 [app] [I] Started GET "/notification_recipients" for 10.76.33.235 at 2017-08-29 04:41:27 -0400
2017-08-29 04:41:27 9d7a7ee1 [app] [I] Processing by NotificationRecipientsController#index as JSON
2017-08-29 04:41:27 9d7a7ee1 [app] [I] Current user: admin (administrator)
2017-08-29 04:41:27 9d7a7ee1 [app] [I] Completed 200 OK in 4ms (Views: 0.1ms | ActiveRecord: 0.4ms)

Comment 2 Daniel Lobato Garcia 2017-08-31 12:04:46 UTC
Created redmine issue http://projects.theforeman.org/issues/20817 from this bug

Comment 4 Jitendra Yejare 2017-09-13 10:23:25 UTC
Same issue observed from API end.

Comment 5 Marek Hulan 2017-10-25 14:58:25 UTC
So, the incoming parameters are Parameters: {"filter"=>{"role_id"=>42, "organization_ids"=>[], "location_ids"=>[]} which indicates hammer did not send those values. This was already fixed in upstream by https://github.com/theforeman/hammer-cli-foreman/pull/313 and released in hammer-cli-foreman 0.11.

Comment 7 Jitendra Yejare 2017-10-25 15:19:35 UTC
Verified !

@Satellite 6.3 Snap 21

Steps:
1. Created Role
2. Added filter(overridden/non-overridden) to the above role 
3. From hammer CLI, updated filter to assign some taxonomies

Result:
Taxonomies of role filters are updated

Comment 8 Bryan Kearney 2018-02-21 16:32:57 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-2018:0336


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