Merge "Parameterization support added for VNFD templates"

This commit is contained in:
Jenkins 2015-09-05 00:32:06 +00:00 committed by Gerrit Code Review
commit 0d21069505
2 changed files with 10 additions and 0 deletions

View File

@ -61,6 +61,10 @@ class CreateVNF(tackerV10.CreateCommand):
parser.add_argument(
'--config',
help='specify config yaml file')
parser.add_argument(
'--param-file',
help='specify parameter yaml file'
)
def args2body(self, parsed_args):
body = {self.resource: {}}
@ -79,6 +83,10 @@ class CreateVNF(tackerV10.CreateCommand):
parsed_args.vnfd_name)
parsed_args.vnfd_id = _id
if parsed_args.param_file:
with open(parsed_args.param_file) as f:
param_yaml = f.read()
body[self.resource]['param_values'] = param_yaml
tackerV10.update_dict(parsed_args, body[self.resource],
['tenant_id', 'name', 'vnfd_id'])

View File

@ -469,6 +469,8 @@ class Client(ClientBase):
arg_[key] = arg[key]
if 'config' in arg:
arg_['attributes'] = {'config': arg['config']}
if 'param_values' in arg:
arg_['attributes'] = {'param_values': arg['param_values']}
body_ = {self._DEVICE: arg_}
ret = self.create_device(body_)
return {self._VNF: ret[self._DEVICE]}