Description of problem: Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. Order a service through /api/service_catalogs/3/service_templates endpoint with a request object have a requester with auto_approve=true, such as: content = { :action => "order", :resource => { :href => "http://miq.coe.evenit.info:3000/api/service_catalogs/3/service_templates/2", :devops_project_business_unit_id => "428800024", :devops_project_name => "api_test2", :devops_project_team_development => "development_team_a", :devops_project_team_review => "review_team_y", :devops_project_team_production => "production_team_1", }, :requester => { :user_name => 'admin', :auto_approve => true }, } 2. The request is created but is pending due to an assertion in /ManageIQ/System/Policy/ServiceTemplateProvisionRequest_created that checks the value of ${/#miq_request.process}. This assertion is always false when deploying from API. Actual results: The service orders (without shopping cart) through API are always pending. Expected results: The service orders (without shopping cart) through API with auto_approve=true are approved and processed. Additional info: Early discussion with ManageIQ team points to this PR: https://github.com/ManageIQ/manageiq/commit/948647176b6dd671062192eae0e45f6220feffb5. But it may not be related.
Worked with Alberto to track down the issue. The REST API call creates the request differently then the OpsUI, which works with the new shopping cart logic, is doing it. They should both use the OpsUI logic. Code has been tested and once tests are cleaned up we will have a PR available.
https://github.com/ManageIQ/manageiq/pull/9276
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/52be816b9ac11515fa31c0ee0e86b166c4a2fa7e commit 52be816b9ac11515fa31c0ee0e86b166c4a2fa7e Author: Alberto Bellotti <abellott> AuthorDate: Thu Jun 16 17:58:41 2016 -0400 Commit: Alberto Bellotti <abellott> CommitDate: Fri Jun 17 16:32:19 2016 -0400 [api] Fix for service_template order - Leverages new resource action workflow's submit_request - Provides validation - Added Service Template validate_order method and orderable? alias - Updated rspecs https://bugzilla.redhat.com/show_bug.cgi?id=1347409 app/controllers/api_controller/service_orders.rb | 4 ++ .../api_controller/service_templates.rb | 17 +++-- app/models/service_template.rb | 5 ++ config/api.yml | 2 + spec/requests/api/service_catalogs_spec.rb | 78 ++++++++++++++++++++-- spec/support/api_spec_helper.rb | 4 ++ 6 files changed, 96 insertions(+), 14 deletions(-)
Looks good to me. I checked out the commit and my test is ok.
https://github.com/ManageIQ/manageiq/pull/7620
Taras, lean on Shveta if you need assistance with services.
In fact, it's not backported yet... putting back to ON_DEV.
Odd, PR# 9276 showed backported to darga. I labeled https://github.com/ManageIQ/manageiq/pull/9276 back to darga/yes.