summaryrefslogtreecommitdiffstats
path: root/yardstick/common/utils.py
diff options
context:
space:
mode:
authorchenjiankun <chenjiankun1@huawei.com>2017-02-20 16:05:29 +0000
committerchenjiankun <chenjiankun1@huawei.com>2017-02-24 02:40:30 +0000
commit8fdfd0f7ae809966e946b9425838e5c2c2fad215 (patch)
tree4f8c264e5d581c727656d835acedcecae01e1ff5 /yardstick/common/utils.py
parent63d4d99cbe9fe57f71da6173eac4626107bfaa51 (diff)
Add common method of openstack in openstack_utils
JIRA: YARDSTICK-569 We have much redundancy code when using nova/neutron/glance... python client. So I write this code in openstack_utils for calling. Change-Id: I322b7577de4933246a15e6742ae5a28bea16eb02 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'yardstick/common/utils.py')
-rw-r--r--yardstick/common/utils.py17
1 files changed, 0 insertions, 17 deletions
diff --git a/yardstick/common/utils.py b/yardstick/common/utils.py
index 04536190b..3c5895f1e 100644
--- a/yardstick/common/utils.py
+++ b/yardstick/common/utils.py
@@ -26,9 +26,6 @@ import sys
from functools import reduce
import yaml
-from keystoneauth1 import identity
-from keystoneauth1 import session
-from neutronclient.v2_0 import client
from oslo_utils import importutils
from oslo_serialization import jsonutils
@@ -134,20 +131,6 @@ def source_env(env_file):
return env
-def get_openstack_session():
- auth = identity.Password(auth_url=os.environ.get('OS_AUTH_URL'),
- username=os.environ.get('OS_USERNAME'),
- password=os.environ.get('OS_PASSWORD'),
- tenant_name=os.environ.get('OS_TENANT_NAME'))
- return session.Session(auth=auth)
-
-
-def get_neutron_client():
- sess = get_openstack_session()
- neutron_client = client.Client(session=sess)
- return neutron_client
-
-
def read_json_from_file(path):
with open(path, 'r') as f:
return jsonutils.load(f)