Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1229818 - CFME 5.4 beta - There seems to be no way of approving an Automation Task in state "Pending Approval"
CFME 5.4 beta - There seems to be no way of approving an Automation Task in s...
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: API (Show other bugs)
5.4.0
Unspecified Unspecified
high Severity medium
: GA
: 5.6.0
Assigned To: abellott
Taras Lehinevych
rest:automate:retest
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-06-09 13:21 EDT by Peter McGowan
Modified: 2016-06-29 10:56 EDT (History)
9 users (show)

See Also:
Fixed In Version: 5.6.0.8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-29 10:56:35 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1348 normal SHIPPED_LIVE CFME 5.6.0 bug fixes and enhancement update 2016-06-29 14:50:04 EDT

  None (edit)
Description Peter McGowan 2015-06-09 13:21:55 EDT
Description of problem:
If I submit an automation request through the RESTful API as a non-admin user, the task is submitted correctly and goes into state 'Pending Approval". As an admin user in the WebUI I can see this task under Automate -> Requests, but there seems to be no way of approving it.

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

How reproducible:
Every time

Steps to Reproduce:
1. Submit a an automation task through the RESTful API, specifying a non-admin user:

  post_params = {
    :version => '1.1',
    :uri_parts => {
      :namespace => namespace,
      :class => 'Methods',
      :instance => instance
    },
    :parameters => parameter_hash,
    :requester => {
      :auto_approve => false
    }
  }.to_json
  query = "/api/automation_requests"
  rest_return = RestClient::Request.execute(method: :post, url: url + query, :user => username, \
                :password => password, :headers => {:accept => :json}, :payload => post_params, verify_ssl: false)




Actual results:
The request goes into a "Pending Approval", but there seems to be no way of approving it.

Expected results:
An admin user should be able to see any request marked as Pending Approval, and approve any request.


Additional info:
If I change the :auto_approve => false to :auto_approve => true, I get a 500 Internal Server error back from CloudForms, but the request still seems to be submitted
Comment 2 abellott 2015-10-19 14:55:28 EDT
gmccullo@redhat.com not sure this is API related. I see the problem at hand, created an InspectME automation request, request submitted, in the Automate->Requests page, I see the request details with Approval State "Pending Approval", yet no way to approve as admin. Is there a special entitlement to have to do this or is it to be approved a different way ?  Thanks.
Comment 3 Peter McGowan 2016-02-09 02:21:06 EST
Interestingly, I created an automation request approval workflow and documented here:

https://pemcg.gitbooks.io/introduction-to-cloudforms-automation/content/chapter21/automation_request_approval.html. 

When an approver receives an email containing a line such as:

"To view this Request go to: https://192.168.1.245/miq_request/show/1000000000125"

They can click on the URI and actually get the ability to approve the automation request; all works as expected. For some reason we just can't approve when we go through Automate -> Requests in the WebUI.
Comment 9 CFME Bot 2016-05-23 18:00:47 EDT
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/ccac5fb79c6655bb4c29469000dc36fdbae023d6

commit ccac5fb79c6655bb4c29469000dc36fdbae023d6
Author:     Alberto Bellotti <abellott@redhat.com>
AuthorDate: Fri May 20 12:50:42 2016 -0400
Commit:     Alberto Bellotti <abellott@redhat.com>
CommitDate: Fri May 20 15:46:39 2016 -0400

    [api] Adding support for Automation Request approve/deny
    
    - Support approving or denying automation requests
      on multiple requests when targeting /api/automation_requests
      or single request when targeting /api/automation_requests/:id
    - support action "approve"
    - support action "deny"
    - updated spec/requests/api/automation_requests_spec.rb
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1229818

 .../api_controller/automation_requests.rb          | 22 ++++++++
 config/api.yml                                     | 10 ++++
 spec/requests/api/automation_requests_spec.rb      | 62 ++++++++++++++++++++++
 3 files changed, 94 insertions(+)
Comment 10 Oleg Barenboim 2016-05-23 22:32:50 EDT
Backported to Darga branch.
Comment 11 Taras Lehinevych 2016-06-15 08:13:59 EDT
Verified in 5.6.0.10-rc2.1
Comment 13 errata-xmlrpc 2016-06-29 10:56:35 EDT
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/RHBA-2016:1348

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