Stop passing auth_token to ironic-inspector-client

This has been deprecated long ago, and will be removed really soon.
Create a Token authentication, build a Session and pass it instead.
This reflects how a session was created with auth_token inside the
client previously.

Change-Id: I3ce2916872b6ba4c36d4d6f294456454eee78314
This commit is contained in:
Dmitry Tantsur 2017-11-17 13:14:57 +01:00
parent 139d3ea5f3
commit 76eba6cc2a
1 changed files with 5 additions and 2 deletions

View File

@ -18,6 +18,8 @@ from oslo_config import cfg
from oslo_log import log
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
@ -400,11 +402,12 @@ class BaremetalIntrospectionAction(base.OpenStackAction):
inspector_endpoint = keystone_utils.get_endpoint_for_project(
service_type='baremetal-introspection'
)
auth = Token(endpoint=inspector_endpoint.url,
token=context.auth_token)
return self._get_client_class()(
api_version=1,
inspector_url=inspector_endpoint.url,
auth_token=context.auth_token,
session=ks_session.Session(auth)
)