diff options
Diffstat (limited to 'functest/utils')
-rwxr-xr-x[-rw-r--r--] | functest/utils/constants.py | 0 | ||||
-rw-r--r-- | functest/utils/functest_constants.py | 27 | ||||
-rw-r--r-- | functest/utils/openstack_tacker.py | 22 |
3 files changed, 12 insertions, 37 deletions
diff --git a/functest/utils/constants.py b/functest/utils/constants.py index 2e8eb3f4..2e8eb3f4 100644..100755 --- a/functest/utils/constants.py +++ b/functest/utils/constants.py diff --git a/functest/utils/functest_constants.py b/functest/utils/functest_constants.py index bd109785..0a9a03b1 100644 --- a/functest/utils/functest_constants.py +++ b/functest/utils/functest_constants.py @@ -195,33 +195,6 @@ ONOS_INSTALLER_MASTER_USERNAME = get_value( ONOS_INSTALLER_MASTER_PASSWORD = get_value( 'ONOS.environment.installer_master_password', 'ONOS_INSTALLER_MASTER_PASSWORD') -PROMISE_REPO_DIR = get_value('general.dir.dir_repo_promise', - 'PROMISE_REPO_DIR') -PROMISE_TENANT_NAME = get_value('promise.tenant_name', - 'PROMISE_TENANT_NAME') -TENANT_DESCRIPTION = get_value('promise.tenant_description', - 'TENANT_DESCRIPTION') -PROMISE_USER_NAME = get_value('promise.user_name', 'PROMISE_USER_NAME') -PROMISE_USER_PWD = get_value('promise.user_pwd', 'PROMISE_USER_PWD') -PROMISE_IMAGE_NAME = get_value('promise.image_name', - 'PROMISE_IMAGE_NAME') -PROMISE_FLAVOR_NAME = get_value('promise.flavor_name', - 'PROMISE_FLAVOR_NAME') -PROMISE_FLAVOR_VCPUS = get_value('promise.flavor_vcpus', - 'PROMISE_FLAVOR_VCPUS') -PROMISE_FLAVOR_RAM = get_value('promise.flavor_ram', - 'PROMISE_FLAVOR_RAM') -PROMISE_FLAVOR_DISK = get_value('promise.flavor_disk', - 'PROMISE_FLAVOR_DISK') -PROMISE_NET_NAME = get_value('promise.network_name', 'PROMISE_NET_NAME') -PROMISE_SUBNET_NAME = get_value('promise.subnet_name', - 'PROMISE_SUBNET_NAME') -PROMISE_SUBNET_CIDR = get_value('promise.subnet_cidr', - 'PROMISE_SUBNET_CIDR') -PROMISE_ROUTER_NAME = get_value('promise.router_name', - 'PROMISE_ROUTER_NAME') -COPPER_REPO_DIR = get_value('general.dir.repo_copper', - 'COPPER_REPO_DIR') EXAMPLE_INSTANCE_NAME = get_value('example.vm_name', 'EXAMPLE_INSTANCE_NAME') EXAMPLE_FLAVOR = get_value('example.flavor', 'EXAMPLE_FLAVOR') diff --git a/functest/utils/openstack_tacker.py b/functest/utils/openstack_tacker.py index f17b421e..c7ac89af 100644 --- a/functest/utils/openstack_tacker.py +++ b/functest/utils/openstack_tacker.py @@ -20,9 +20,9 @@ import time logger = ft_logger.Logger("tacker_utils").getLogger() -def get_tacker_client(): - creds_tacker = os_utils.get_credentials() - return tackerclient.Client(**creds_tacker) +def get_tacker_client(other_creds={}): + sess = os_utils.get_session(other_creds) + return tackerclient.Client(session=sess) # ********************************************* @@ -74,12 +74,12 @@ def create_vnfd(tacker_client, tosca_file=None): if tosca_file is not None: with open(tosca_file) as tosca_fd: vnfd_body = tosca_fd.read() - logger.error(vnfd_body) + logger.info('VNFD template:\n{0}'.format(vnfd_body)) return tacker_client.create_vnfd( body={"vnfd": {"attributes": {"vnfd": vnfd_body}}}) except Exception, e: - logger.exception("Error [create_vnfd(tacker_client, '%s')]: %s" - % (tosca_file, e)) + logger.error("Error [create_vnfd(tacker_client, '%s')]: %s" + % (tosca_file, e)) return None @@ -124,7 +124,8 @@ def create_vnf(tacker_client, vnf_name, vnfd_id=None, vnfd_name=None): vnf_body['vnf']['vnfd_id'] = get_vnfd_id(tacker_client, vnfd_name) return tacker_client.create_vnf(body=vnf_body) except Exception, e: - logger.error("error [create_vnf(tacker_client, '%s', '%s', '%s')]: %s" + logger.error("error [create_vnf(tacker_client," + " '%s', '%s', '%s')]: %s" % (vnf_name, vnfd_id, vnfd_name, e)) return None @@ -206,7 +207,8 @@ def create_sfc(tacker_client, sfc_name, for name in chain_vnf_names] return tacker_client.create_sfc(body=sfc_body) except Exception, e: - logger.error("error [create_sfc(tacker_client, '%s', '%s', '%s')]: %s" + logger.error("error [create_sfc(tacker_client," + " '%s', '%s', '%s')]: %s" % (sfc_name, chain_vnf_ids, chain_vnf_names, e)) return None @@ -263,8 +265,8 @@ def create_sfc_classifier(tacker_client, sfc_clf_name, sfc_id=None, tacker_client, sfc_name) return tacker_client.create_sfc_classifier(body=sfc_clf_body) except Exception, e: - logger.error("error [create_sfc_classifier(tacker_client, '%s', '%s'," - " '%s', '%s')]: '%s'" + logger.error("error [create_sfc_classifier(tacker_client," + " '%s', '%s','%s', '%s')]: '%s'" % (sfc_clf_name, sfc_id, sfc_name, str(match), e)) return None |