From 0ab99ba102cfa888f8219af5b4cdb1271ae577d2 Mon Sep 17 00:00:00 2001 From: George Paraskevopoulos Date: Wed, 15 Feb 2017 13:59:00 +0200 Subject: Add parameterized vnfd capabilities on vnf create JIRA: SFC-73 We can pass parameters to vnfds when creating a vnf. We need this now to specify the availability zone Change-Id: I8d6533ca331361f1581059050aa773936b4dff66 Signed-off-by: George Paraskevopoulos --- functest/utils/openstack_tacker.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/functest/utils/openstack_tacker.py b/functest/utils/openstack_tacker.py index c7ac89af..f3597965 100644 --- a/functest/utils/openstack_tacker.py +++ b/functest/utils/openstack_tacker.py @@ -108,7 +108,8 @@ def list_vnfs(tacker_client, verbose=False): return None -def create_vnf(tacker_client, vnf_name, vnfd_id=None, vnfd_name=None): +def create_vnf(tacker_client, vnf_name, vnfd_id=None, + vnfd_name=None, param_file=None): try: vnf_body = { 'vnf': { @@ -116,6 +117,10 @@ def create_vnf(tacker_client, vnf_name, vnfd_id=None, vnfd_name=None): 'name': vnf_name } } + if param_file is not None: + with open(param_file) as f: + params = f.read() + vnf_body['vnf']['attributes']['param_values'] = params if vnfd_id is not None: vnf_body['vnf']['vnfd_id'] = vnfd_id else: -- cgit 1.2.3-korg