]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Security credentials are now passed into heat engine from cli
authorChris Alfonso <calfonso@redhat.com>
Wed, 28 Mar 2012 20:23:15 +0000 (16:23 -0400)
committerChris Alfonso <calfonso@redhat.com>
Wed, 28 Mar 2012 20:25:22 +0000 (16:25 -0400)
The request parameter KeyStoneCreds has the values for username,
password, tenant, and authurl

Fixes #30

README.rst
bin/heat
heat/api/v1/stacks.py
heat/client.py
heat/cloudformations.py

index 07c33c6d541c305cec7b6d2f36951eb7dc0ff924..e706d77e56e1d3d479e2ac942629ef9b04e9ccda 100644 (file)
@@ -33,7 +33,8 @@ shell2:
     sudo heat-engine
 
 shell3:
-
+    
+    heat create_jeos F16 x86_64
     heat create my_stack --template-url=https://raw.github.com/heat-api/heat/master/templates/WordPress_Single_Instance.template
 
 References
index 0cc67078b5b403de2d41d1adbee1da0b58b2b8b8..5f4ec5bc2f8f5063a83eb87acb16bcb3d01749cd 100755 (executable)
--- a/bin/heat
+++ b/bin/heat
@@ -16,7 +16,6 @@ import sys
 import time
 import json
 
-
 from urlparse import urlparse
 
 # If ../heat/__init__.py exists, add ../ to Python search path, so that
@@ -81,8 +80,8 @@ def template_validate(options, arguments):
         print 'Please specify a template file or url'
         return FAILURE
 
-    c = get_client(options)
-    result = c.validate_template(**parameters)
+    client = get_client(options)
+    result = client.validate_template(**parameters)
     print json.dumps(result, indent=2)
 
 @catch_error('gettemplate')
index 2b195e66704033684147fb606eecf95efa1e3fad..d1b9bd4aa60c5af9eb05c12a8f180d29318dcfab 100644 (file)
@@ -125,7 +125,7 @@ class StackController(object):
 
     def validate_template(self, req):
 
-        c = engine.get_engine_client(req.context)
+        client = engine.get_engine_client(req.context)
 
         try:
             templ = self._get_template(req)
@@ -143,7 +143,7 @@ class StackController(object):
             return webob.exc.HTTPBadRequest(explanation=msg)
 
         logger.info('validate_template')
-        return c.validate_template(stack, **req.params)
+        return client.validate_template(stack, **req.params)
 
     def delete(self, req):
         """
index fae1a3e8f1364e18a4baadab169f63fd8e72a2b0..ed73b7c382c7a1789d6c6ccc409629d5d99ba80a 100644 (file)
@@ -39,6 +39,7 @@ class V1Client(base_client.BaseClient):
         params['Version'] = '2010-05-15'
         params['SignatureVersion'] = '2'
         params['SignatureMethod'] = 'HmacSHA256'
+        params['KeyStoneCreds'] = self.creds
 
     def list_stacks(self, **kwargs):
         params = self._extract_params(kwargs, SUPPORTED_PARAMS)
@@ -91,7 +92,7 @@ class V1Client(base_client.BaseClient):
     def validate_template(self, **kwargs):
         params = self._extract_params(kwargs, SUPPORTED_PARAMS)
         self._insert_common_parameters(params)
-
+        
         res = self.do_request("GET", "/ValidateTemplate", params=params)
         data = json.loads(res.read())
         return data
index 8ad3026bd9666f9fedb2a598a1042270f584e97f..c26a3a60e4c78994b54f0a6ff27fdbfaddedf848 100644 (file)
@@ -15,5 +15,5 @@
 
 SUPPORTED_PARAMS = ('StackName', 'TemplateBody', 'TemplateUrl','NotificationARNs', 'Parameters',
                     'Version', 'SignatureVersion', 'Timestamp', 'AWSAccessKeyId',
-                    'Signature')
+                    'Signature', 'KeyStoneCreds')