Fix config and param data handling for Deploy VNF

Config and param values are set in vnf arg and initialized to None
values even though param/config files are not provided.

This throws an exception in Heat Translator code for Tosca templates
when it tries to iterate over parsed_params which has None value.

Change-Id: I564405cd1d9e8819ee8ad391e910e30895fb0d94
Closes-Bug: #1563597
This commit is contained in:
Sripriya 2016-03-29 17:24:00 -07:00
parent c0b2bb0e16
commit 2b5c7d9a79

View File

@ -154,14 +154,19 @@ class DeployVNF(forms.SelfHandlingForm):
vnfd_id = data['vnfd_id']
vim_id = data['vim_id']
region_name = data['region_name']
param_val = data['param_values']
config_val = data['config_values']
vnf_arg = {'vnf': {'vnfd_id': vnfd_id, 'name': vnf_name,
'vim_id': vim_id,
'attributes': {'param_values': data[
'param_values'], 'config': data[
'config_values']}}}
'vim_id': vim_id}}
if region_name:
vnf_arg.setdefault('placement_attr', {})[
region_name] = region_name
vnf_attr = vnf_arg['vnf'].setdefault('attributes', {})
if param_val:
vnf_attr['param_values'] = param_val
if config_val:
vnf_attr['config'] = config_val
api.tacker.create_vnf(request, vnf_arg)
messages.success(request,
_('VNF %s create operation initiated.') %