Bug 842408

Summary: Broker use of REST API libraries does not reflect recent changes in library code under RHC
Product: OKD Reporter: N. Harrison Ripps <hripps>
Component: PodAssignee: N. Harrison Ripps <hripps>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: urgent Docs Contact:
Priority: high    
Version: 2.xCC: jhou, rmillner
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: rhc-broker-0.96.3-1 (possibly rhc-broker-0.96.2-1) Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-07 20:43:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description N. Harrison Ripps 2012-07-23 19:23:39 UTC
Description of problem:
Recently, the REST API 'send' function was renamed to 'request' to prevent name space collisions with the native Ruby function of the same name. However, the application template functions under the broker are still using the old method. This is causing attempts to generate descriptors for new app types to fail.

Version-Release number of selected component (if applicable):
Problems exists as of commit f6d4fec3a59c6bbd07314f5a017bc2049419694f on broker codebase.

How reproducible:


Steps to Reproduce:
1. Check out latest li, rhc and cvrankcase codebases
2. Fire up a devenv
3. In devenv, cd to broker/application_templates
4. Remove the descriptor.yaml file from any existing template in broker/application_templates/templates/*
5. Run rake descriptors:generate
  
Actual results:
You will see an error of the variety:

rake aborted!
#<RestClient::Request:0x7fa078607c80 @ssl_client_key=nil, @headers={"Authorization"=>"Basic aHJpcHBzQHJlZGhhdC5jb206IU1NM2xoMzFt\n", :accept=>:json}, @processed_headers={"Accept-Encoding"=>"gzip, deflate", "Authorization"=>"Basic aHJpcHBzQHJlZGhhdC5jb206IU1NM2xoMzFt\n", "Accept"=>"application/json"}, @ssl_client_cert=nil, @timeout=nil, @payload=nil, @tf=nil, @method="GET", @verify_ssl=false, @url="https://localhost/broker/rest/domains/nhrtest/applications/djangotest/descriptor", @password=nil, @cookies={}, @ssl_ca_file=nil, @raw_response=false, @open_timeout=nil, @args={:url=>"https://localhost/broker/rest/domains/nhrtest/applications/djangotest/descriptor", :method=>"GET", :headers=>{"Authorization"=>"Basic aHJpcHBzQHJlZGhhdC5jb206IU1NM2xoMzFt\n", :accept=>:json}}, @user=nil> is not a symbol

Expected results:
The command will run successfully and the deleted descriptor.yaml file will have been re-created.

Comment 1 N. Harrison Ripps 2012-07-23 19:24:23 UTC
I have a fix in the works.

Comment 3 N. Harrison Ripps 2012-07-24 13:01:35 UTC
Revised steps to reproduce:

1. Check out latest li, rhc and cvrankcase codebases
2. Fire up a devenv
3. SSH into the devenv
4. Run 'rhc setup'. Go through the normal rhc setup, including providing your own OpenShift username and password. When the process asks for a namespace, specify a new namespace.
5. Now cd to broker/application_templates
4. Remove the descriptor.yaml file from any existing template in broker/application_templates/templates/*
5. Run rake descriptors:generate. When asked for a password, use your OpenShift password again.

Comment 4 Jianwei Hou 2012-07-25 01:43:23 UTC
Verified on devenv_1910

Steps:
1.Launch a latest devenv
2.ssh into devenv
3.run 'rhc setup', go through the setup and provide username and password, specify a namespace
4.cd /usr/lib/stickshift/broker/application_templates
  remove all descriptor.yaml under       /usr/lib/stickshift/broker/application_templates/templates/*
5.rake descriptors:generate, when asked for a password, use the Openshift password.

Results:

[root@ip-10-62-22-123 application_templates]# rake descriptors:generate
(in /usr/lib/stickshift/broker/application_templates)
Password: 
Checking template for wordpress
Creating application wordpress
Creating application wordpress......done
Embedding cartridge: mysql-5.1......done
Destroying application wordpress......done
Checking template for rails
Creating application rails
Creating application rails......done
Embedding cartridge: mysql-5.1......done
Destroying application rails......done
Checking template for springeap6
Creating application springeap6
Creating application springeap6......done
Destroying application springeap6......done
Checking template for railstest
Creating application railstest
Creating application railstest......done
Embedding cartridge: mysql-5.1......done
Destroying application railstest......done
Checking template for drupal
Creating application drupal
Creating application drupal......done
Embedding cartridge: mysql-5.1......done
Destroying application drupal......done
Checking template for kitchensink
Creating application kitchensink
Creating application kitchensink......done
Destroying application kitchensink......done

descriptor.yaml are created under  /usr/lib/stickshift/broker/application_templates/templates/*