summaryrefslogtreecommitdiffstats
path: root/testing/robot
diff options
context:
space:
mode:
authorTomas Cechvala <tcechval@cisco.com>2017-03-09 14:05:57 +0100
committerTomas Cechvala <tcechval@cisco.com>2017-03-09 14:07:35 +0100
commit3ce8b6143a2eac2de4df17cab3e2c7ad9ea2acb6 (patch)
treef8fdc3ddf49912d3c367965d0e142748e9c725e3 /testing/robot
parent251655730cd037a9bd5dbbb42ba07cb64bacde88 (diff)
Initializing nova client by session API
Authentication problems solved by using the keystoneauth session API. Change-Id: I4e031f012278e19bb78c692c4c45891061f8b128 Signed-off-by: Tomas Cechvala <tcechval@cisco.com>
Diffstat (limited to 'testing/robot')
-rw-r--r--testing/robot/lib/FDSLibrary.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/testing/robot/lib/FDSLibrary.py b/testing/robot/lib/FDSLibrary.py
index 3d19680..786cee6 100644
--- a/testing/robot/lib/FDSLibrary.py
+++ b/testing/robot/lib/FDSLibrary.py
@@ -22,23 +22,19 @@ import subprocess
class FDSLibrary():
def __init__(self):
+ auth_obj = loading.get_plugin_loader('password').load_from_options(auth_url=os.getenv('OS_AUTH_URL'),
+ username=os.getenv('OS_USERNAME'),
+ password=os.getenv('OS_PASSWORD'),
+ project_id=os.getenv('OS_PROJECT_ID'))
logger.debug("Initializing glance client.")
- self.glance_client = glance.Client('2', session=session.Session(
- auth=loading.get_plugin_loader('password').load_from_options(auth_url=os.getenv('OS_AUTH_URL'),
- username=os.getenv('OS_USERNAME'),
- password=os.getenv('OS_PASSWORD'),
- project_id=os.getenv('OS_PROJECT_ID'))))
+ self.glance_client = glance.Client('2', session=session.Session(auth=auth_obj))
logger.debug("Initializing neutron client.")
self.neutron_client = neutron.Client(username=os.getenv('OS_USERNAME'),
password=os.getenv('OS_PASSWORD'),
tenant_name=os.getenv('OS_TENANT_NAME'),
auth_url=os.getenv('OS_AUTH_URL'))
logger.debug("Initializing nova client.")
- self.nova_client = nova.Client('2',
- os.getenv('OS_USERNAME'),
- os.getenv('OS_PASSWORD'),
- os.getenv('OS_TENANT_NAME'),
- os.getenv('OS_AUTH_URL'))
+ self.nova_client = nova.Client('2', session=session.Session(auth=auth_obj))
def check_flavor_exists(self, flavor):
flavor_list_names = [x.name for x in self.nova_client.flavors.list()]