summaryrefslogtreecommitdiff
path: root/trove/tests/util
diff options
context:
space:
mode:
authorAmrith Kumar <amrith@amrith.org>2017-05-23 22:22:26 -0400
committerSean Dague <sean@dague.net>2017-05-26 12:46:21 +0000
commit3ed3ea94bb03563a349cde686a8e38f68a7b5a53 (patch)
treeb18a99a7dba72fa85279212af68883e8def42d45 /trove/tests/util
parent012da9a334bc4e9c7711dc918eea3f011463ec82 (diff)
downloadtrove-3ed3ea94bb03563a349cde686a8e38f68a7b5a53.tar.gz
fix issue with Nova passthrough deprecation
Nova Networking was deprecated in Newton and some of the API calls that were part of NN were still in use by Trove. With the arrival of python-novaclient 8.0.0, this caused a failure. Nova also deprecated the image pass through capability. The management API uses some of that to test whether an image id is valid or not. This change fixes the management API, and the attendant scenario tests. Depends-On: I142f97d691fa55e9824714c9c224f998ad72337e Change-Id: I2f2a12207581a94fb8561a6d65a3a79b4a29b063 Closes-Bug: #1690936
Diffstat (limited to 'trove/tests/util')
-rw-r--r--trove/tests/util/__init__.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/trove/tests/util/__init__.py b/trove/tests/util/__init__.py
index f0b8fc26..9ffee23f 100644
--- a/trove/tests/util/__init__.py
+++ b/trove/tests/util/__init__.py
@@ -177,6 +177,24 @@ def create_nova_client(user, service_type=None):
return TestClient(openstack)
+def create_glance_client(user):
+ """Creates a rich client for the Glance API using the test config."""
+ if test_config.glance_client is None:
+ raise SkipTest("No glance_client info specified in the Test Config "
+ "so this test will be skipped.")
+ from glanceclient import Client
+ from keystoneauth1.identity import v2
+ from keystoneauth1 import session
+
+ auth = v2.Password(username=user.auth_user,
+ password=user.auth_key,
+ tenant_name=user.tenant,
+ auth_url=test_config.glance_client['auth_url'])
+ session = session.Session(auth=auth)
+ glance = Client(CONF.glance_client_version, session=session)
+ return TestClient(glance)
+
+
def dns_checker(mgmt_instance):
"""Given a MGMT instance, ensures DNS provisioning worked.