diff options
author | Brady Johnson <bjohnson@inocybe.com> | 2017-09-18 14:58:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-09-18 14:58:51 +0000 |
commit | 3cea8f88d68e71e22be478beab8ce94a0d352392 (patch) | |
tree | f1686e9f12be35edc99039cd01bb0c7caa259666 | |
parent | 7a081b4ebae0b7773d867714b126152476786a0d (diff) | |
parent | e2e0a53027b9ec01b28af8d398cdce0750c08da8 (diff) |
Merge "Bug fix: allows searching vnfd_id based on name" into stable/euphrates
-rw-r--r-- | sfc/lib/openstack_tacker.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sfc/lib/openstack_tacker.py b/sfc/lib/openstack_tacker.py index df112c39..93649e32 100644 --- a/sfc/lib/openstack_tacker.py +++ b/sfc/lib/openstack_tacker.py @@ -141,18 +141,22 @@ def create_vnf(tacker_client, vnf_name, vnfd_id=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 - if vim_id is not None: - vnf_body['vnf']['vim_id'] = vim_id else: if vnfd_name is None: raise Exception('vnfd id or vnfd name is required') vnf_body['vnf']['vnfd_id'] = get_vnfd_id(tacker_client, vnfd_name) + + if vim_id is not None: + vnf_body['vnf']['vim_id'] = vim_id + else: if vim_name is None: raise Exception('vim id or vim name is required') vnf_body['vnf']['vim_id'] = get_vim_id(tacker_client, vim_name) return tacker_client.create_vnf(body=vnf_body) + except Exception, e: logger.error("error [create_vnf(tacker_client," " '%s', '%s', '%s')]: %s" |