From eb592162817184b1d8b3c9b3e576ebc0715ec350 Mon Sep 17 00:00:00 2001 From: Jose Castro Leon Date: Wed, 31 Oct 2018 13:32:31 +0100 Subject: [PATCH] Removes insecure parameter from barbican client This removes the parameter insecure in the client creation as this no longer exists in the client. It also changes the client class to be called as other clients in openstack using sessions Change-Id: I3cb7ed4255f8996b8bfd9a3e1edba6de50f4e492 Closes-Bug: #1800819 --- mistral/actions/openstack/actions.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/mistral/actions/openstack/actions.py b/mistral/actions/openstack/actions.py index a061b0513..6a78fb2e7 100644 --- a/mistral/actions/openstack/actions.py +++ b/mistral/actions/openstack/actions.py @@ -20,7 +20,6 @@ from oslo_utils import importutils from keystoneauth1 import session as ks_session from keystoneauth1.token_endpoint import Token -from keystoneclient.auth import identity from keystoneclient import httpclient from mistral.actions.openstack import base @@ -574,6 +573,7 @@ class ZaqarAction(base.OpenStackAction): class BarbicanAction(base.OpenStackAction): + _service_type = 'key-manager' @classmethod def _get_client_class(cls): @@ -583,21 +583,12 @@ class BarbicanAction(base.OpenStackAction): LOG.debug("Barbican action security context: %s", context) - barbican_endpoint = keystone_utils.get_endpoint_for_project('barbican') - keystone_endpoint = keystone_utils.get_keystone_endpoint() - - auth = identity.v3.Token( - auth_url=keystone_endpoint.url, - project_name=context.user_name, - token=context.auth_token, - project_id=context.project_id - ) + barbican_endpoint = self.get_service_endpoint() + session_and_auth = self.get_session_and_auth(context) return self._get_client_class()( - project_id=context.project_id, endpoint=barbican_endpoint.url, - auth=auth, - insecure=context.insecure + session=session_and_auth['session'] ) @classmethod