Commit c2afddfd authored by Pavel Abalikhin's avatar Pavel Abalikhin Committed by Vlad Gusev

Fix initialization of Barbican client

Region and endpoint_type parameters should be used when initializing
Barbican client.

Change-Id: Id5a0c6f061e36b93e82d2eea8a5bac9ede66b159
Story: 2005233
Task: 30015
(cherry picked from commit dc5a708d9a9d8b29de3c97a685c83872e0f10531)
parent dd70fec0
......@@ -90,4 +90,7 @@ class BarbicanACLAuth(barbican_common.BarbicanAuth):
user_session = session.Session(auth=user_auth)
# create a special barbican client with our user's session
return barbican_client.Client(session=user_session)
return barbican_client.Client(
session=user_session,
region_name=CONF.certificates.region_name,
interface=CONF.certificates.endpoint_type)
......@@ -33,7 +33,7 @@ class TestBarbicanACLAuth(base.TestCase):
# Reset the client
keystone._SESSION = None
self.conf = self.useFixture(oslo_fixture.Config(cfg.CONF))
self.conf.config(group="certificates", region_name=None)
self.conf.config(group="certificates", region_name='RegionOne')
self.conf.config(group="certificates", endpoint_type='publicURL')
@mock.patch('keystoneauth1.session.Session', mock.Mock())
......@@ -91,3 +91,5 @@ class TestBarbicanACLAuth(base.TestCase):
bc = acl_auth_object.get_barbican_client_user_auth(mock.Mock())
self.assertTrue(hasattr(bc, 'containers') and
hasattr(bc.containers, 'register_consumer'))
self.assertEqual('publicURL', bc.client.interface)
self.assertEqual('RegionOne', bc.client.region_name)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment