From: George Paraskevopoulos Date: Wed, 15 Feb 2017 11:59:00 +0000 (+0200) Subject: Add parameterized vnfd capabilities on vnf create X-Git-Tag: danube.1.RC1~128 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=0ab99ba102cfa888f8219af5b4cdb1271ae577d2;p=functest.git 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 --- diff --git a/functest/utils/openstack_tacker.py b/functest/utils/openstack_tacker.py index c7ac89af9..f3597965f 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: