Remove hardcoded usage of v2 authentication in Barbican actions

There are still some hardcoded v2 authentication in barbican actions.
This api has been deprecated and removed, so we can change it to use
instead v3. It also removes the version number from some helper methods.

Change-Id: I0390daf841463d11cb7c61653897949989b6e6eb
Closes-bug: #1783316
This commit is contained in:
Jose Castro Leon 2018-07-24 13:32:07 +02:00
parent 8806b5b7d8
commit 36f28dec45
2 changed files with 11 additions and 11 deletions

View File

@ -581,13 +581,13 @@ 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_v2()
keystone_endpoint = keystone_utils.get_keystone_endpoint()
auth = identity.v2.Token(
auth = identity.v3.Token(
auth_url=keystone_endpoint.url,
tenant_name=context.user_name,
project_name=context.user_name,
token=context.auth_token,
tenant_id=context.project_id
project_id=context.project_id
)
return self._get_client_class()(
@ -722,7 +722,7 @@ class MagnumAction(base.OpenStackAction):
LOG.debug("Magnum action security context: %s", context)
keystone_endpoint = keystone_utils.get_keystone_endpoint_v2()
keystone_endpoint = keystone_utils.get_keystone_endpoint()
auth_url = keystone_endpoint.url
magnum_url = keystone_utils.get_endpoint_for_project('magnum').url
@ -751,7 +751,7 @@ class MuranoAction(base.OpenStackAction):
LOG.debug("Murano action security context: %s", context)
keystone_endpoint = keystone_utils.get_keystone_endpoint_v2()
keystone_endpoint = keystone_utils.get_keystone_endpoint()
murano_endpoint = self.get_service_endpoint()
return self._get_client_class()(
@ -779,7 +779,7 @@ class TackerAction(base.OpenStackAction):
LOG.debug("Tacker action security context: %s", context)
keystone_endpoint = keystone_utils.get_keystone_endpoint_v2()
keystone_endpoint = keystone_utils.get_keystone_endpoint()
tacker_endpoint = self.get_service_endpoint()
return self._get_client_class()(
@ -807,7 +807,7 @@ class SenlinAction(base.OpenStackAction):
LOG.debug("Senlin action security context: %s", context)
keystone_endpoint = keystone_utils.get_keystone_endpoint_v2()
keystone_endpoint = keystone_utils.get_keystone_endpoint()
senlin_endpoint = self.get_service_endpoint()
return self._get_client_class()(
@ -955,7 +955,7 @@ class ZunAction(base.OpenStackAction):
LOG.debug("Zun action security context: %s", context)
keystone_endpoint = keystone_utils.get_keystone_endpoint_v2()
keystone_endpoint = keystone_utils.get_keystone_endpoint()
zun_endpoint = self.get_service_endpoint()
session_and_auth = self.get_session_and_auth(context)

View File

@ -248,11 +248,11 @@ def obtain_service_catalog(ctx):
return service_catalog
def get_keystone_endpoint_v2():
def get_keystone_endpoint():
return get_endpoint_for_project('keystone', service_type='identity')
def get_keystone_url_v2():
def get_keystone_url():
return get_endpoint_for_project('keystone', service_type='identity').url