Add back in keystone v3 support for basic_deployment.py

A recent commit (ecfd7a64ad) tidied up the
keystone authentication in basic_deployment.py across most of the
charms. Barbican was a bit different in that it has an explicit v3 test
as it was implemented a bit odly and so needed a v3 test for the main
barbican software.

This fix puts back in keystone v3 support for basic_deployment.py

Change-Id: Ic689914402b7966632530d5d595d64f87f3e95bf
Closes-Bug: #1712849
This commit is contained in:
Alex Kavanagh 2017-08-25 15:20:44 +01:00
parent e6698818e7
commit f492bb250c
1 changed files with 16 additions and 4 deletions

View File

@ -106,10 +106,22 @@ class BarbicanBasicDeployment(OpenStackAmuletDeployment):
self._get_openstack_release_string()))
# Authenticate admin with keystone endpoint
self.keystone = u.authenticate_keystone_admin(self.keystone_sentry,
user='admin',
password='openstack',
tenant='admin')
if self._keystone_version == '2':
self.keystone = u.authenticate_keystone_admin(
self.keystone_sentry,
user='admin',
password='openstack',
tenant='admin')
elif self._keystone_version == '3':
# use default admin values in u.authenticate_keystone_admins()
# for user_domain_name, etc.
self.keystone = u.authenticate_keystone_admin(
self.keystone_sentry,
user='admin',
password='openstack',
api_version=3)
else:
raise RuntimeError("keystone version must be '2' or '3'")
def test_100_services(self):
"""Verify the expected services are running on the corresponding