Add environment_files to REST and RPC APIs

Adds an optional list of environment files that can be specified instead
of resolving multiple environments client-side. This change covers both
the REST API changes and the internal RPC API changes.

APIImpact
Implements: blueprint multi-environments
Change-Id: I45fb9d4480f6ab4e5fe30cb2e3b62a03777484c7
This commit is contained in:
Jay Dobies 2015-10-28 11:07:32 -04:00
parent 3fdf463136
commit c2d8a15b24
10 changed files with 199 additions and 94 deletions

View File

@ -49,6 +49,7 @@ class InstantiationData(object):
PARAM_USER_PARAMS,
PARAM_ENVIRONMENT,
PARAM_FILES,
PARAM_ENVIRONMENT_FILES,
) = (
'stack_name',
'template',
@ -56,6 +57,7 @@ class InstantiationData(object):
'parameters',
'environment',
'files',
'environment_files',
)
def __init__(self, data, patch=False):
@ -145,6 +147,9 @@ class InstantiationData(object):
def files(self):
return self.data.get(self.PARAM_FILES, {})
def environment_files(self):
return self.data.get(self.PARAM_ENVIRONMENT_FILES, None)
def args(self):
"""Get any additional arguments supplied by the user."""
params = self.data.items()
@ -346,12 +351,15 @@ class StackController(object):
data = InstantiationData(body)
args = self.prepare_args(data)
result = self.rpc_client.preview_stack(req.context,
data.stack_name(),
data.template(),
data.environment(),
data.files(),
args)
result = self.rpc_client.preview_stack(
req.context,
data.stack_name(),
data.template(),
data.environment(),
data.files(),
args,
environment_files=data.environment_files()
)
formatted_stack = stacks_view.format_stack(req, result)
return {'stack': formatted_stack}
@ -372,12 +380,14 @@ class StackController(object):
data = InstantiationData(body)
args = self.prepare_args(data)
result = self.rpc_client.create_stack(req.context,
data.stack_name(),
data.template(),
data.environment(),
data.files(),
args)
result = self.rpc_client.create_stack(
req.context,
data.stack_name(),
data.template(),
data.environment(),
data.files(),
args,
environment_files=data.environment_files())
formatted_stack = stacks_view.format_stack(
req,
@ -444,12 +454,14 @@ class StackController(object):
data = InstantiationData(body)
args = self.prepare_args(data)
self.rpc_client.update_stack(req.context,
identity,
data.template(),
data.environment(),
data.files(),
args)
self.rpc_client.update_stack(
req.context,
identity,
data.template(),
data.environment(),
data.files(),
args,
environment_files=data.environment_files())
raise exc.HTTPAccepted()
@ -463,12 +475,14 @@ class StackController(object):
data = InstantiationData(body, patch=True)
args = self.prepare_args(data)
self.rpc_client.update_stack(req.context,
identity,
data.template(),
data.environment(),
data.files(),
args)
self.rpc_client.update_stack(
req.context,
identity,
data.template(),
data.environment(),
data.files(),
args,
environment_files=data.environment_files())
raise exc.HTTPAccepted()
@ -484,7 +498,8 @@ class StackController(object):
data.template(),
data.environment(),
data.files(),
args)
args,
environment_files=data.environment_files())
return {'resource_changes': changes}
@ -500,7 +515,8 @@ class StackController(object):
data.template(),
data.environment(),
data.files(),
args)
args,
environment_files=data.environment_files())
return {'resource_changes': changes}
@ -553,11 +569,13 @@ class StackController(object):
params[p_name] = self._extract_bool_param(p_name, params[p_name])
show_nested = params[p_name]
result = self.rpc_client.validate_template(req.context,
data.template(),
data.environment(),
files=data.files(),
show_nested=show_nested)
result = self.rpc_client.validate_template(
req.context,
data.template(),
data.environment(),
files=data.files(),
environment_files=data.environment_files(),
show_nested=show_nested)
if 'Error' in result:
raise exc.HTTPBadRequest(result['Error'])

View File

@ -300,6 +300,7 @@ class StackResource(resource.Resource):
child_env.user_env_as_dict(),
parsed_template.files,
args,
None,
owner_id=self.stack.id,
user_creds_id=self.stack.user_creds_id,
stack_user_project_id=stack_user_project_id,

View File

@ -292,7 +292,7 @@ class EngineService(service.Service):
by the RPC caller.
"""
RPC_API_VERSION = '1.21'
RPC_API_VERSION = '1.23'
def __init__(self, host, topic):
super(EngineService, self).__init__()
@ -650,7 +650,8 @@ class EngineService(service.Service):
return stack
@context.request_context
def preview_stack(self, cnxt, stack_name, template, params, files, args):
def preview_stack(self, cnxt, stack_name, template, params, files,
args, environment_files=None):
"""Simulate a new stack using the provided template.
Note that at this stage the template has already been fetched from the
@ -662,6 +663,9 @@ class EngineService(service.Service):
:param params: Stack Input Params
:param files: Files referenced from the template
:param args: Request parameters/args passed from API
:param environment_files: optional ordered list of environment file
names included in the files dict
:type environment_files: list or None
"""
LOG.info(_LI('previewing stack %s'), stack_name)
@ -679,7 +683,8 @@ class EngineService(service.Service):
return api.format_stack_preview(stack)
@context.request_context
def create_stack(self, cnxt, stack_name, template, params, files, args,
def create_stack(self, cnxt, stack_name, template, params, files,
args, environment_files=None,
owner_id=None, nested_depth=0, user_creds_id=None,
stack_user_project_id=None, parent_resource_name=None):
"""Create a new stack using the template provided.
@ -693,6 +698,9 @@ class EngineService(service.Service):
:param params: Stack Input Params
:param files: Files referenced from the template
:param args: Request parameters/args passed from API
:param environment_files: optional ordered list of environment file
names included in the files dict
:type environment_files: list or None
:param owner_id: parent stack ID for nested stacks, only expected when
called from another heat-engine (not a user option)
:param nested_depth: the nested depth for nested stacks, only expected
@ -840,7 +848,7 @@ class EngineService(service.Service):
@context.request_context
def update_stack(self, cnxt, stack_identity, template, params,
files, args):
files, args, environment_files=None):
"""Update an existing stack based on the provided template and params.
Note that at this stage the template has already been fetched from the
@ -852,6 +860,9 @@ class EngineService(service.Service):
:param params: Stack Input Params
:param files: Files referenced from the template
:param args: Request parameters/args passed from API
:param environment_files: optional ordered list of environment file
names included in the files dict
:type environment_files: list or None
"""
# Get the database representation of the existing stack
db_stack = self._get_stack(cnxt, stack_identity)
@ -891,8 +902,8 @@ class EngineService(service.Service):
@context.request_context
def preview_update_stack(self, cnxt, stack_identity, template, params,
files, args):
"""Show the resources that would be updated.
files, args, environment_files=None):
"""Shows the resources that would be updated.
The preview_update_stack method shows the resources that would be
changed with an update to an existing stack based on the provided
@ -984,7 +995,7 @@ class EngineService(service.Service):
@context.request_context
def validate_template(self, cnxt, template, params=None, files=None,
show_nested=False):
environment_files=None, show_nested=False):
"""Check the validity of a template.
Checks, so far as we can, that a template is valid, and returns
@ -995,6 +1006,9 @@ class EngineService(service.Service):
:param template: Template of stack you want to create.
:param params: Stack Input Params
:param files: Files referenced from the template
:param environment_files: optional ordered list of environment file
names included in the files dict
:type environment_files: list or None
:param show_nested: if True, any nested templates will be checked
"""
LOG.info(_LI('validate_template'))

View File

@ -41,6 +41,7 @@ class EngineClient(object):
1.20 - Add resolve_outputs to stack show
1.21 - Add deployment_id to create_software_deployment
1.22 - Add support for stack export
1.23 - Add environment_files to create/update/preview/validate
"""
BASE_RPC_API_VERSION = '1.0'
@ -188,7 +189,8 @@ class EngineClient(object):
resolve_outputs=resolve_outputs),
version='1.20')
def preview_stack(self, ctxt, stack_name, template, params, files, args):
def preview_stack(self, ctxt, stack_name, template, params, files,
args, environment_files=None):
"""Simulates a new stack using the provided template.
Note that at this stage the template has already been fetched from the
@ -200,13 +202,20 @@ class EngineClient(object):
:param params: Stack Input Params/Environment
:param files: files referenced from the environment.
:param args: Request parameters/args passed from API
:param environment_files: optional ordered list of environment file
names included in the files dict
:type environment_files: list or None
"""
return self.call(ctxt,
self.make_msg('preview_stack', stack_name=stack_name,
template=template,
params=params, files=files, args=args))
params=params, files=files,
environment_files=environment_files,
args=args),
version='1.23')
def create_stack(self, ctxt, stack_name, template, params, files, args):
def create_stack(self, ctxt, stack_name, template, params, files,
args, environment_files=None):
"""Creates a new stack using the template provided.
Note that at this stage the template has already been fetched from the
@ -218,11 +227,15 @@ class EngineClient(object):
:param params: Stack Input Params/Environment
:param files: files referenced from the environment.
:param args: Request parameters/args passed from API
:param environment_files: optional ordered list of environment file
names included in the files dict
:type environment_files: list or None
"""
return self._create_stack(ctxt, stack_name, template, params, files,
args)
args, environment_files=environment_files)
def _create_stack(self, ctxt, stack_name, template, params, files, args,
def _create_stack(self, ctxt, stack_name, template, params, files,
args, environment_files=None,
owner_id=None, nested_depth=0, user_creds_id=None,
stack_user_project_id=None, parent_resource_name=None):
"""Internal interface for engine-to-engine communication via RPC.
@ -239,16 +252,17 @@ class EngineClient(object):
return self.call(
ctxt, self.make_msg('create_stack', stack_name=stack_name,
template=template,
params=params, files=files, args=args,
owner_id=owner_id,
params=params, files=files,
environment_files=environment_files,
args=args, owner_id=owner_id,
nested_depth=nested_depth,
user_creds_id=user_creds_id,
stack_user_project_id=stack_user_project_id,
parent_resource_name=parent_resource_name),
version='1.8')
version='1.23')
def update_stack(self, ctxt, stack_identity, template, params,
files, args):
files, args, environment_files=None):
"""Updates an existing stack based on the provided template and params.
Note that at this stage the template has already been fetched from the
@ -260,16 +274,22 @@ class EngineClient(object):
:param params: Stack Input Params/Environment
:param files: files referenced from the environment.
:param args: Request parameters/args passed from API
:param environment_files: optional ordered list of environment file
names included in the files dict
:type environment_files: list or None
"""
return self.call(ctxt, self.make_msg('update_stack',
stack_identity=stack_identity,
template=template,
params=params,
files=files,
args=args))
return self.call(ctxt,
self.make_msg('update_stack',
stack_identity=stack_identity,
template=template,
params=params,
files=files,
environment_files=environment_files,
args=args),
version='1.23')
def preview_update_stack(self, ctxt, stack_identity, template, params,
files, args):
files, args, environment_files=None):
"""Returns the resources that would be changed in an update.
Based on the provided template and parameters.
@ -282,6 +302,9 @@ class EngineClient(object):
:param params: Stack Input Params/Environment
:param files: files referenced from the environment.
:param args: Request parameters/args passed from API
:param environment_files: optional ordered list of environment file
names included in the files dict
:type environment_files: list or None
"""
return self.call(ctxt,
self.make_msg('preview_update_stack',
@ -289,26 +312,31 @@ class EngineClient(object):
template=template,
params=params,
files=files,
environment_files=environment_files,
args=args,
),
version='1.15')
version='1.23')
def validate_template(self, ctxt, template, params=None, files=None,
show_nested=False):
environment_files=None, show_nested=False):
"""Uses the stack parser to check the validity of a template.
:param ctxt: RPC context.
:param template: Template of stack you want to create.
:param params: Stack Input Params/Environment
:param files: files referenced from the environment/template.
:param environment_files: ordered list of environment file names
included in the files dict
:param show_nested: if True nested templates will be validated
"""
return self.call(ctxt, self.make_msg('validate_template',
template=template,
params=params,
files=files,
show_nested=show_nested),
version='1.18')
return self.call(ctxt,
self.make_msg('validate_template',
template=template,
params=params,
files=files,
environment_files=environment_files,
show_nested=show_nested),
version='1.23')
def authenticated_to_backend(self, ctxt):
"""Validate the credentials in the RPC context.

View File

@ -535,13 +535,14 @@ class CfnStackControllerTest(common.HeatTestCase):
'template': self.template,
'params': engine_parms,
'files': {},
'environment_files': None,
'args': engine_args,
'owner_id': None,
'nested_depth': 0,
'user_creds_id': None,
'parent_resource_name': None,
'stack_user_project_id': None}),
version='1.8'
version='1.23'
).AndRaise(failure)
def _stub_rpc_create_stack_call_success(self, stack_name, engine_parms,
@ -563,13 +564,14 @@ class CfnStackControllerTest(common.HeatTestCase):
'template': self.template,
'params': engine_parms,
'files': {},
'environment_files': None,
'args': engine_args,
'owner_id': None,
'nested_depth': 0,
'user_creds_id': None,
'parent_resource_name': None,
'stack_user_project_id': None}),
version='1.8'
version='1.23'
).AndReturn(engine_resp)
self.m.ReplayAll()
@ -877,7 +879,9 @@ class CfnStackControllerTest(common.HeatTestCase):
'template': self.template,
'params': engine_parms,
'files': {},
'args': engine_args})
'environment_files': None,
'args': engine_args}),
version='1.23'
).AndReturn(identity)
self.m.ReplayAll()
@ -1095,8 +1099,9 @@ class CfnStackControllerTest(common.HeatTestCase):
rpc_client.EngineClient.call(
dummy_req.context,
('validate_template', {'template': json_template, 'params': None,
'files': None, 'show_nested': False}),
version='1.18'
'files': None, 'environment_files': None,
'show_nested': False}),
version='1.23'
).AndReturn(response)
self.m.ReplayAll()

View File

@ -641,6 +641,7 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
body = {'template': template,
'stack_name': identity.stack_name,
'parameters': parameters,
'environment_files': ['foo.yaml'],
'timeout_mins': 30}
req = self._post('/stacks', json.dumps(body))
@ -657,13 +658,14 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': ['foo.yaml'],
'args': {'timeout_mins': 30},
'owner_id': None,
'nested_depth': 0,
'user_creds_id': None,
'parent_resource_name': None,
'stack_user_project_id': None}),
version='1.8'
version='1.23'
).AndReturn(dict(identity))
self.m.ReplayAll()
@ -703,13 +705,14 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'args': {'timeout_mins': 30, 'tags': ['tag1', 'tag2']},
'owner_id': None,
'nested_depth': 0,
'user_creds_id': None,
'parent_resource_name': None,
'stack_user_project_id': None}),
version='1.8'
version='1.23'
).AndReturn(dict(identity))
self.m.ReplayAll()
@ -766,6 +769,7 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'args': {'timeout_mins': 30,
'adopt_stack_data': str(adopt_data)},
'owner_id': None,
@ -773,7 +777,7 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'user_creds_id': None,
'parent_resource_name': None,
'stack_user_project_id': None}),
version='1.8'
version='1.23'
).AndReturn(dict(identity))
self.m.ReplayAll()
@ -856,13 +860,14 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {'my.yaml': 'This is the file contents.'},
'environment_files': None,
'args': {'timeout_mins': 30},
'owner_id': None,
'nested_depth': 0,
'user_creds_id': None,
'parent_resource_name': None,
'stack_user_project_id': None}),
version='1.8'
version='1.23'
).AndReturn(dict(identity))
self.m.ReplayAll()
@ -902,13 +907,14 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'args': {'timeout_mins': 30},
'owner_id': None,
'nested_depth': 0,
'user_creds_id': None,
'parent_resource_name': None,
'stack_user_project_id': None}),
version='1.8'
version='1.23'
).AndRaise(tools.to_remote_error(AttributeError()))
rpc_client.EngineClient.call(
req.context,
@ -921,13 +927,14 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'args': {'timeout_mins': 30},
'owner_id': None,
'nested_depth': 0,
'user_creds_id': None,
'parent_resource_name': None,
'stack_user_project_id': None}),
version='1.8'
version='1.23'
).AndRaise(tools.to_remote_error(unknown_parameter))
rpc_client.EngineClient.call(
req.context,
@ -940,13 +947,14 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'args': {'timeout_mins': 30},
'owner_id': None,
'nested_depth': 0,
'user_creds_id': None,
'parent_resource_name': None,
'stack_user_project_id': None}),
version='1.8'
version='1.23'
).AndRaise(tools.to_remote_error(missing_parameter))
self.m.ReplayAll()
resp = tools.request_with_middleware(fault.FaultWrapper,
@ -999,13 +1007,14 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'args': {'timeout_mins': 30},
'owner_id': None,
'nested_depth': 0,
'user_creds_id': None,
'parent_resource_name': None,
'stack_user_project_id': None}),
version='1.8'
version='1.23'
).AndRaise(tools.to_remote_error(error))
self.m.ReplayAll()
@ -1084,13 +1093,14 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'args': {'timeout_mins': 30},
'owner_id': None,
'nested_depth': 0,
'user_creds_id': None,
'parent_resource_name': None,
'stack_user_project_id': None}),
version='1.8'
version='1.23'
).AndRaise(tools.to_remote_error(error))
self.m.ReplayAll()
@ -1098,7 +1108,6 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
self.controller.create,
req, tenant_id=self.tenant,
body=body)
self.assertEqual(400, resp.json['code'])
self.assertEqual('StackValidationFailed', resp.json['error']['type'])
self.m.VerifyAll()
@ -1169,7 +1178,9 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'args': {'timeout_mins': 30, 'tags': ['tag1', 'tag2']}})
'environment_files': None,
'args': {'timeout_mins': 30, 'tags': ['tag1', 'tag2']}}),
version='1.23'
)
self.assertEqual({'stack': 'formatted_stack_preview'}, response)
@ -1204,8 +1215,9 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'args': {'timeout_mins': 30}}),
version='1.15'
version='1.23'
).AndReturn(resource_changes)
self.m.ReplayAll()
@ -1245,9 +1257,10 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'args': {rpc_api.PARAM_EXISTING: True,
'timeout_mins': 30}}),
version='1.15'
version='1.23'
).AndReturn(resource_changes)
self.m.ReplayAll()
@ -1672,7 +1685,9 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'args': {'timeout_mins': 30}})
'environment_files': None,
'args': {'timeout_mins': 30}}),
version='1.23'
).AndReturn(dict(identity))
self.m.ReplayAll()
@ -1710,7 +1725,9 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'args': {'timeout_mins': 30, 'tags': ['tag1', 'tag2']}})
'environment_files': None,
'args': {'timeout_mins': 30, 'tags': ['tag1', 'tag2']}}),
version='1.23'
).AndReturn(dict(identity))
self.m.ReplayAll()
@ -1748,7 +1765,9 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
u'event_sinks': [],
u'resource_registry': {}},
'files': {},
'args': {'timeout_mins': 30}})
'environment_files': None,
'args': {'timeout_mins': 30}}),
version='1.23'
).AndRaise(tools.to_remote_error(error))
self.m.ReplayAll()
@ -1833,8 +1852,10 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'args': {rpc_api.PARAM_EXISTING: True,
'timeout_mins': 30}})
'timeout_mins': 30}}),
version='1.23'
).AndReturn(dict(identity))
self.m.ReplayAll()
@ -1870,8 +1891,10 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'args': {rpc_api.PARAM_EXISTING: True,
'timeout_mins': 30}})
'timeout_mins': 30}}),
version='1.23'
).AndReturn(dict(identity))
self.m.ReplayAll()
@ -1908,9 +1931,11 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'args': {rpc_api.PARAM_EXISTING: True,
'timeout_mins': 30,
'tags': ['tag1', 'tag2']}})
'tags': ['tag1', 'tag2']}}),
version='1.23'
).AndReturn(dict(identity))
self.m.ReplayAll()
@ -1947,8 +1972,10 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'args': {rpc_api.PARAM_EXISTING: True,
'timeout_mins': 30}})
'timeout_mins': 30}}),
version='1.23'
).AndReturn(dict(identity))
self.m.ReplayAll()
@ -2011,9 +2038,11 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'args': {rpc_api.PARAM_EXISTING: True,
'clear_parameters': clear_params,
'timeout_mins': 30}})
'timeout_mins': 30}}),
version='1.23'
).AndReturn(dict(identity))
self.m.ReplayAll()
@ -2053,9 +2082,11 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'args': {rpc_api.PARAM_EXISTING: True,
'clear_parameters': clear_params,
'timeout_mins': 30}})
'timeout_mins': 30}}),
version='1.23'
).AndReturn(dict(identity))
self.m.ReplayAll()
@ -2216,8 +2247,9 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'show_nested': False}),
version='1.18'
version='1.23'
).AndReturn(engine_response)
self.m.ReplayAll()
@ -2245,8 +2277,9 @@ class StackControllerTest(tools.ControllerTest, common.HeatTestCase):
'event_sinks': [],
'resource_registry': {}},
'files': {},
'environment_files': None,
'show_nested': False}),
version='1.18'
version='1.23'
).AndReturn({'Error': 'fubar'})
self.m.ReplayAll()

View File

@ -67,7 +67,7 @@ class Engine(message_processor.MessageProcessor):
srv.thread_group_mgr = thread_group_mgr
hot_tmpl = self.scenario_template_to_hot(scenario_tmpl)
srv.create_stack(cnxt, stack_name, hot_tmpl,
params={}, files={}, args={})
params={}, files={}, environment_files=None, args={})
@message_processor.asynchronous
def update_stack(self, stack_name, scenario_tmpl):
@ -82,7 +82,7 @@ class Engine(message_processor.MessageProcessor):
'tenant': db_stack.tenant,
'path': ''}
srv.update_stack(cnxt, stack_identity, hot_tmpl,
params={}, files={}, args={})
params={}, files={}, environment_files=None, args={})
@message_processor.asynchronous
def delete_stack(self, stack_name):

View File

@ -40,7 +40,7 @@ class ServiceEngineTest(common.HeatTestCase):
def test_make_sure_rpc_version(self):
self.assertEqual(
'1.21',
'1.23',
service.EngineService.RPC_API_VERSION,
('RPC version is changed, please update this test to new version '
'and make sure additional test cases are added for RPC APIs '

View File

@ -148,6 +148,7 @@ class EngineRpcAPITestCase(common.HeatTestCase):
template={u'Foo': u'bar'},
params={u'InstanceType': u'm1.xlarge'},
files={u'a_file': u'the contents'},
environment_files=['foo.yaml'],
args={'timeout_mins': u'30'})
def test_create_stack(self):
@ -155,6 +156,7 @@ class EngineRpcAPITestCase(common.HeatTestCase):
template={u'Foo': u'bar'},
params={u'InstanceType': u'm1.xlarge'},
files={u'a_file': u'the contents'},
environment_files=['foo.yaml'],
args={'timeout_mins': u'30'})
call_kwargs = copy.deepcopy(kwargs)
call_kwargs['owner_id'] = None
@ -172,6 +174,7 @@ class EngineRpcAPITestCase(common.HeatTestCase):
template={u'Foo': u'bar'},
params={u'InstanceType': u'm1.xlarge'},
files={},
environment_files=['foo.yaml'],
args=mock.ANY)
def test_preview_update_stack(self):
@ -180,6 +183,7 @@ class EngineRpcAPITestCase(common.HeatTestCase):
template={u'Foo': u'bar'},
params={u'InstanceType': u'm1.xlarge'},
files={},
environment_files=['foo.yaml'],
args=mock.ANY)
def test_get_template(self):
@ -199,6 +203,7 @@ class EngineRpcAPITestCase(common.HeatTestCase):
template={u'Foo': u'bar'},
params={u'Egg': u'spam'},
files=None,
environment_files=['foo.yaml'],
show_nested=False)
def test_list_resource_types(self):

View File

@ -840,6 +840,7 @@ class WithTemplateTest(StackResourceBaseTest):
{'disable_rollback': True,
'adopt_stack_data': adopt_data_str,
'timeout_mins': self.timeout_mins},
None,
stack_user_project_id='aprojectid',
parent_resource_name='test',
user_creds_id='uc123',