Bug 867565 - Template rake tasks are broken due to incompatibilities with current REST API
Template rake tasks are broken due to incompatibilities with current REST API
Status: CLOSED WONTFIX
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
2.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Fotios Lindiakos
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-17 14:27 EDT by Dan Mace
Modified: 2015-05-14 22:06 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-15 10:38:51 EST
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)

  None (edit)
Description Dan Mace 2012-10-17 14:27:26 EDT
Description of problem:

The Rake tasks which are used to manage template operations (e.g., generation, deletion, listing) are broken due to incompatibilities with the current REST API.  For example, the rest_extra.rb utility relies on a @links variable which is no longer defined.  There may be other problems of which I am currently unaware.

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


How reproducible:

Try using any of the template rake tasks, including list.

Steps to Reproduce:

See above.
  
Actual results:

Ruby exceptions.

Expected results:

Successful executions.

Additional info:

Here is an example exception:

/usr/lib/openshift/broker/application_templates $ rake templates:destroy --trace
(in /usr/lib/openshift/broker/application_templates)
** Invoke templates:destroy (first_time)
** Execute templates:destroy
Password: 
rake aborted!
undefined method `[]' for nil:NilClass
./lib/rest_extra.rb:18:in `templates'
/usr/lib/openshift/broker/application_templates/tasks/destroy.rake:7
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:635:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:635:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:630:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:630:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:589:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:582:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2050:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2067:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2022:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2067:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1997:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
Comment 1 Fotios Lindiakos 2012-10-17 15:32:40 EDT
Fixed in https://github.com/openshift/li/pull/494
Comment 2 joycezhang 2012-10-23 02:29:07 EDT
Verified on devenv_2364, template list, destroy, clear, profile, generate are fixed as below:

# rake templates:list --trace
(in /usr/lib/openshift/broker/application_templates)
** Invoke templates:list (first_time)
** Execute templates:list
Password: 
CakePHP (4c3b6266f37843d1993164b0665bf464)
CakePHP (TEST) (bb26617183dc45b8ba2f5bcc0fc61068)
CakePHP (dd9bc930f1bb41e68ba28e01c5ac49c8)
Django (44a5f357beef4657b391807fd379db05)
Django (Test) (d2ffc6c4f32449dca079dad8b6b045b4)
Django (02fcf6feff454b98b705b6c4fd7e709f)
Drupal (8f6e1cfa54d441ad84baac0e992581c4)
Drupal (f91649bb39304ee49bc71958d50be4c8)
JavaEE Full Profile Example on JBoss (b766252ecd3d4a5e922df86abbfe685d)
JavaEE Full Profile Example on JBoss (a5e4d7be7dff41cb9e2aafe7f95afba0)
Ruby on Rails (05cc65a253604b0ca6be35bfabc07d86)
Ruby on Rails (1b30e0f5d51e4372bf97ea1a02999464)
Spring Framework on JBoss EAP6 (12430c0b5a4e4ab593f69d8e0347d8ef)
Spring Framework on JBoss EAP6 (8a6af000d62a4ee7afa4099f2d16be72)
WordPress (77640e631347463e83306a0be6be1a66)
WordPress (374d12857b07486095affeda931313fa)

# rake templates:destroy --trace
(in /usr/lib/openshift/broker/application_templates)
** Invoke templates:destroy (first_time)
** Execute templates:destroy
Password: 
Creating script to destroy templates......done


# rake descriptors:generate --trace
(in /usr/lib/openshift/broker/application_templates)
** Invoke descriptors:generate (first_time)
** Execute descriptors:generate
Password: 
Checking template for djangotest
Descriptor already exists for djangotest...reusing
Checking template for cakephp
Descriptor already exists for cakephp...reusing
Checking template for kitchensinktypeless
Descriptor already exists for kitchensinktypeless...reusing
Checking template for wordpress
Descriptor already exists for wordpress...reusing
Checking template for drupaltypeless
Descriptor already exists for drupaltypeless...reusing
Checking template for django
Descriptor already exists for django...reusing
Checking template for rails
Descriptor already exists for rails...reusing
Checking template for springeap6typeless
Descriptor already exists for springeap6typeless...reusing
Checking template for springeap6
Descriptor already exists for springeap6...reusing
Checking template for wordpresstypeless
Descriptor already exists for wordpresstypeless...reusing
Checking template for cakephptypeless
Descriptor already exists for cakephptypeless...reusing
Checking template for cakephptest
Descriptor already exists for cakephptest...reusing
Checking template for railstypeless
Descriptor already exists for railstypeless...reusing
Checking template for drupal
Descriptor already exists for drupal...reusing
Checking template for kitchensink
Descriptor already exists for kitchensink...reusing
Checking template for djangotypeless
Descriptor already exists for djangotypeless...reusing



However, rake template task deploy still has problem as below:

# rake templates:deploy --trace
(in /usr/lib/openshift/broker/application_templates)
** Invoke templates:deploy (first_time)
** Execute templates:deploy
Password: 
Which template would you like to deploy?
 0: CakePHP
 1: CakePHP (TEST)
 2: CakePHP
 3: Django
 4: Django (Test)
 5: Django
 6: Drupal
 7: Drupal
 8: JavaEE Full Profile Example on JBoss
 9: JavaEE Full Profile Example on JBoss
10: Ruby on Rails
11: Ruby on Rails
12: Spring Framework on JBoss EAP6
13: Spring Framework on JBoss EAP6
14: WordPress
15: WordPress
Selection: 
Name for application: 
rake aborted!
can't convert String into Integer
/usr/lib/openshift/broker/application_templates/tasks/deploy.rake:16:in `[]'
/usr/lib/openshift/broker/application_templates/tasks/deploy.rake:16
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:635:in `call'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:635:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:630:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:630:in `execute'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:589:in `invoke_with_call_chain'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:582:in `invoke'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2050:in `invoke_task'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:in `each'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2028:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2067:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2022:in `top_level'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2067:in `standard_exception_handling'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1997:in `run'
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

So assign it back as template deploy still has problem. Thanks.
Comment 3 Clayton Coleman 2012-10-30 13:16:14 EDT
Not exposed to external developers, does not block any functional work in this sprint (Dan mace was able to deliver his work), marking low severity.
Comment 4 Clayton Coleman 2012-11-15 10:38:51 EST
With the switch to quickstarts this should no longer be required.

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