diff --git a/bin/heat b/bin/heat index 17533de0f0..dc361449e2 100755 --- a/bin/heat +++ b/bin/heat @@ -105,9 +105,12 @@ def stack_create(options, arguments): return FAILURE if options.parameters: + count=1 for p in options.parameters.split(';'): (n, v) = p.split('=') - parameters[n] = v + parameters['Parameters.member.%d.ParameterKey' % count] = n + parameters['Parameters.member.%d.ParameterValue' % count] = v + count = count + 1 if options.template_file: parameters['TemplateBody'] = open(options.template_file).read() @@ -133,6 +136,19 @@ def stack_update(options, arguments): print "as the first argument" return FAILURE + if options.template_file: + parameters['TemplateBody'] = open(options.template_file).read() + elif options.template_url: + parameters['TemplateUrl'] = options.template_url + + if options.parameters: + count=1 + for p in options.parameters.split(';'): + (n, v) = p.split('=') + parameters['Parameters.member.%d.ParameterKey' % count] = n + parameters['Parameters.member.%d.ParameterValue' % count] = v + count = count + 1 + c = get_client(options) result = c.update_stack(parameters) print json.dumps(result, indent=2) diff --git a/heat/api/v1/stacks.py b/heat/api/v1/stacks.py index 222e2426c8..909ee31684 100644 --- a/heat/api/v1/stacks.py +++ b/heat/api/v1/stacks.py @@ -69,7 +69,7 @@ class StackController(object): } ]}]}]} - + def describe(self, req): return {'stack': [ @@ -77,7 +77,7 @@ class StackController(object): 'name': '', 'container_format': '' } ] } - + def create(self, req): for p in req.params: @@ -110,7 +110,7 @@ class StackController(object): :raises HttpNotAuthorized if image or any chunk is not deleteable by the requesting user """ - + class StackDeserializer(wsgi.JSONRequestDeserializer): """Handles deserialization of specific controller method requests.""" diff --git a/heat/common/client.py b/heat/common/client.py index 9c5154dc55..5a63f3e288 100644 --- a/heat/common/client.py +++ b/heat/common/client.py @@ -581,13 +581,12 @@ class BaseClient(object): reduced to :retval subset of 'params' dict """ - #result = {} + result = {} - #for allowed_param in allowed_params: - # if allowed_param in actual_params: - # result[allowed_param] = actual_params[allowed_param] + for param in actual_params: + if param in allowed_params: + result[param] = actual_params[param] + elif 'Parameters.member.' in param: + result[param] = actual_params[param] - #return result - - # allow user parameters - return actual_params + return result