summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-08-03 11:03:26 +0000
committerGerrit Code Review <review@openstack.org>2018-08-03 11:03:26 +0000
commit952967a019ba2af6b3c7b661addb59d5f4187f24 (patch)
tree73a57dba6bbad0368f98645b0e5d4dac5dd7d484
parent2c644bdb05348e7e104d983ded7d05497a708744 (diff)
parent36f28dec45dd07691995e939e7d04708c59483f4 (diff)
Merge "Remove hardcoded usage of v2 authentication in Barbican actions"7.0.0.0b3
-rw-r--r--mistral/actions/openstack/actions.py18
-rw-r--r--mistral/utils/openstack/keystone.py4
2 files changed, 11 insertions, 11 deletions
diff --git a/mistral/actions/openstack/actions.py b/mistral/actions/openstack/actions.py
index be28113..ab3036e 100644
--- a/mistral/actions/openstack/actions.py
+++ b/mistral/actions/openstack/actions.py
@@ -584,13 +584,13 @@ class BarbicanAction(base.OpenStackAction):
584 LOG.debug("Barbican action security context: %s", context) 584 LOG.debug("Barbican action security context: %s", context)
585 585
586 barbican_endpoint = keystone_utils.get_endpoint_for_project('barbican') 586 barbican_endpoint = keystone_utils.get_endpoint_for_project('barbican')
587 keystone_endpoint = keystone_utils.get_keystone_endpoint_v2() 587 keystone_endpoint = keystone_utils.get_keystone_endpoint()
588 588
589 auth = identity.v2.Token( 589 auth = identity.v3.Token(
590 auth_url=keystone_endpoint.url, 590 auth_url=keystone_endpoint.url,
591 tenant_name=context.user_name, 591 project_name=context.user_name,
592 token=context.auth_token, 592 token=context.auth_token,
593 tenant_id=context.project_id 593 project_id=context.project_id
594 ) 594 )
595 595
596 return self._get_client_class()( 596 return self._get_client_class()(
@@ -725,7 +725,7 @@ class MagnumAction(base.OpenStackAction):
725 725
726 LOG.debug("Magnum action security context: %s", context) 726 LOG.debug("Magnum action security context: %s", context)
727 727
728 keystone_endpoint = keystone_utils.get_keystone_endpoint_v2() 728 keystone_endpoint = keystone_utils.get_keystone_endpoint()
729 auth_url = keystone_endpoint.url 729 auth_url = keystone_endpoint.url
730 magnum_url = keystone_utils.get_endpoint_for_project('magnum').url 730 magnum_url = keystone_utils.get_endpoint_for_project('magnum').url
731 731
@@ -754,7 +754,7 @@ class MuranoAction(base.OpenStackAction):
754 754
755 LOG.debug("Murano action security context: %s", context) 755 LOG.debug("Murano action security context: %s", context)
756 756
757 keystone_endpoint = keystone_utils.get_keystone_endpoint_v2() 757 keystone_endpoint = keystone_utils.get_keystone_endpoint()
758 murano_endpoint = self.get_service_endpoint() 758 murano_endpoint = self.get_service_endpoint()
759 759
760 return self._get_client_class()( 760 return self._get_client_class()(
@@ -782,7 +782,7 @@ class TackerAction(base.OpenStackAction):
782 782
783 LOG.debug("Tacker action security context: %s", context) 783 LOG.debug("Tacker action security context: %s", context)
784 784
785 keystone_endpoint = keystone_utils.get_keystone_endpoint_v2() 785 keystone_endpoint = keystone_utils.get_keystone_endpoint()
786 tacker_endpoint = self.get_service_endpoint() 786 tacker_endpoint = self.get_service_endpoint()
787 787
788 return self._get_client_class()( 788 return self._get_client_class()(
@@ -810,7 +810,7 @@ class SenlinAction(base.OpenStackAction):
810 810
811 LOG.debug("Senlin action security context: %s", context) 811 LOG.debug("Senlin action security context: %s", context)
812 812
813 keystone_endpoint = keystone_utils.get_keystone_endpoint_v2() 813 keystone_endpoint = keystone_utils.get_keystone_endpoint()
814 senlin_endpoint = self.get_service_endpoint() 814 senlin_endpoint = self.get_service_endpoint()
815 815
816 return self._get_client_class()( 816 return self._get_client_class()(
@@ -958,7 +958,7 @@ class ZunAction(base.OpenStackAction):
958 958
959 LOG.debug("Zun action security context: %s", context) 959 LOG.debug("Zun action security context: %s", context)
960 960
961 keystone_endpoint = keystone_utils.get_keystone_endpoint_v2() 961 keystone_endpoint = keystone_utils.get_keystone_endpoint()
962 zun_endpoint = self.get_service_endpoint() 962 zun_endpoint = self.get_service_endpoint()
963 session_and_auth = self.get_session_and_auth(context) 963 session_and_auth = self.get_session_and_auth(context)
964 964
diff --git a/mistral/utils/openstack/keystone.py b/mistral/utils/openstack/keystone.py
index f5410ac..a61a22c 100644
--- a/mistral/utils/openstack/keystone.py
+++ b/mistral/utils/openstack/keystone.py
@@ -248,11 +248,11 @@ def obtain_service_catalog(ctx):
248 return service_catalog 248 return service_catalog
249 249
250 250
251def get_keystone_endpoint_v2(): 251def get_keystone_endpoint():
252 return get_endpoint_for_project('keystone', service_type='identity') 252 return get_endpoint_for_project('keystone', service_type='identity')
253 253
254 254
255def get_keystone_url_v2(): 255def get_keystone_url():
256 return get_endpoint_for_project('keystone', service_type='identity').url 256 return get_endpoint_for_project('keystone', service_type='identity').url
257 257
258 258