Bug 1337987 - Capsule import puppet classes per environment action permission error
Summary: Capsule import puppet classes per environment action permission error
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: Unspecified
Assignee: Tomer Brisker
QA Contact: Kedar Bidarkar
Depends On:
Blocks: 1122832
TreeView+ depends on / blocked
Reported: 2016-05-20 15:47 UTC by Peter Vreman
Modified: 2019-09-26 14:37 UTC (History)
4 users (show)

Fixed In Version: foreman-
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2016-07-27 11:16:01 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 15225 0 None None None 2016-05-30 08:59:47 UTC

Description Peter Vreman 2016-05-20 15:47:24 UTC
Description of problem:
Importing the puppet classes from a smart proxy per environment generates an action permission error:

[crash] root@li-lc-1578:~# curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999}" -XPOST https://localhost/api/v2/smart_proxies/1/environments/29/import_puppetclasses
  "error": {"message":"ERF42-5531 [Foreman::Exception]: unknown permission for api/v2/environments#import_puppetclasses"}

2016-05-20 15:44:38 [app] [I] Started POST "/api/v2/smart_proxies/1/environments/29/import_puppetclasses" for at
2016-05-20 15:44:38 +0000
2016-05-20 15:44:38 [app] [I] Processing by Api::V2::EnvironmentsController#import_puppetclasses as JSON
2016-05-20 15:44:38 [app] [I]   Parameters: {"per_page"=>9999, "apiv"=>"v2", "smart_proxy_id"=>"1", "id"=>"29", "environmen
2016-05-20 15:44:38 [app] [I] Authorized user hoici(hoici )
2016-05-20 15:44:38 [app] [W] Action failed
 | Foreman::Exception: ERF42-5531 [Foreman::Exception]: unknown permission for api/v2/environments#import_puppetclasses
 | /usr/share/foreman/app/controllers/api/base_controller.rb:271:in `action_permission'
 | /usr/share/foreman/app/controllers/api/base_controller.rb:295:in `parent_resource_details'
 | /usr/share/foreman/app/controllers/api/base_controller.rb:220:in `find_nested_object'
 | /usr/share/foreman/app/controllers/api/base_controller.rb:214:in `find_optional_nested_object'
 | /opt/rh/rh-ror41/root/usr/share/gems/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:424:in `block in make_lamb

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

How reproducible:

Steps to Reproduce:
1. API call to POST /api/smart_proxies/:smart_proxy_id/environments/:id/import_puppetclasses 	Import puppet classes from puppet Capsule for an environment

Actual results:

Expected results:

Additional info:

Comment 2 Tomer Brisker 2016-05-30 08:59:46 UTC
Created redmine issue http://projects.theforeman.org/issues/15225 from this bug

Comment 3 Bryan Kearney 2016-06-02 14:16:47 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/15225 has been closed

Comment 4 Kedar Bidarkar 2016-06-16 09:21:17 UTC
 ~]# curl --insecure -X POST -d {\"per_page\":9999} -u admin:changeme -H "Content-Type:application/json" https://localhost/api/v2/smart_proxies/1/environments/1/import_puppetclasses
  "message": "Successfully updated environment and puppetclasses from the on-disk puppet installation",
  "results": {"name":"production","actions":["new"],"new_puppetclasses":["access_insights_client","stdlib","stdlib::stages","foreman_scap_client","foreman_scap_client::params"]}

VERIFIED With sat62-snap(GA)-15.2 (beta2)

Comment 5 Bryan Kearney 2016-07-27 11:16:01 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.


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