Browse Source

Merge "Remove hardcoded usage of v2 authentication in Barbican actions"

Zuul 8 months ago
parent
commit
952967a019
2 changed files with 11 additions and 11 deletions
  1. 9
    9
      mistral/actions/openstack/actions.py
  2. 2
    2
      mistral/utils/openstack/keystone.py

+ 9
- 9
mistral/actions/openstack/actions.py View File

@@ -584,13 +584,13 @@ class BarbicanAction(base.OpenStackAction):
584 584
         LOG.debug("Barbican action security context: %s", context)
585 585
 
586 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 590
             auth_url=keystone_endpoint.url,
591
-            tenant_name=context.user_name,
591
+            project_name=context.user_name,
592 592
             token=context.auth_token,
593
-            tenant_id=context.project_id
593
+            project_id=context.project_id
594 594
         )
595 595
 
596 596
         return self._get_client_class()(
@@ -725,7 +725,7 @@ class MagnumAction(base.OpenStackAction):
725 725
 
726 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 729
         auth_url = keystone_endpoint.url
730 730
         magnum_url = keystone_utils.get_endpoint_for_project('magnum').url
731 731
 
@@ -754,7 +754,7 @@ class MuranoAction(base.OpenStackAction):
754 754
 
755 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 758
         murano_endpoint = self.get_service_endpoint()
759 759
 
760 760
         return self._get_client_class()(
@@ -782,7 +782,7 @@ class TackerAction(base.OpenStackAction):
782 782
 
783 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 786
         tacker_endpoint = self.get_service_endpoint()
787 787
 
788 788
         return self._get_client_class()(
@@ -810,7 +810,7 @@ class SenlinAction(base.OpenStackAction):
810 810
 
811 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 814
         senlin_endpoint = self.get_service_endpoint()
815 815
 
816 816
         return self._get_client_class()(
@@ -958,7 +958,7 @@ class ZunAction(base.OpenStackAction):
958 958
 
959 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 962
         zun_endpoint = self.get_service_endpoint()
963 963
         session_and_auth = self.get_session_and_auth(context)
964 964
 

+ 2
- 2
mistral/utils/openstack/keystone.py View File

@@ -248,11 +248,11 @@ def obtain_service_catalog(ctx):
248 248
     return service_catalog
249 249
 
250 250
 
251
-def get_keystone_endpoint_v2():
251
+def get_keystone_endpoint():
252 252
     return get_endpoint_for_project('keystone', service_type='identity')
253 253
 
254 254
 
255
-def get_keystone_url_v2():
255
+def get_keystone_url():
256 256
     return get_endpoint_for_project('keystone', service_type='identity').url
257 257
 
258 258
 

Loading…
Cancel
Save