]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Move url_for into heat_keystoneclient.
authorSteve Baker <sbaker@redhat.com>
Wed, 17 Jul 2013 02:30:58 +0000 (14:30 +1200)
committerSteve Baker <sbaker@redhat.com>
Thu, 18 Jul 2013 01:35:10 +0000 (13:35 +1200)
This allows faking of this call, and removes one instance of
accessing the encapsulated keystone client.

Change-Id: Iad2a9aaad2e9f1dc3cbeb509c822a61427f12817

heat/common/heat_keystoneclient.py
heat/engine/clients.py
heat/tests/fakes.py

index f9bb9b60f7c91a2062b419cf4cdf4cf256dbf5ae..737a2529b2a5563e915e7073bbb9f569b3d71b33 100644 (file)
@@ -151,3 +151,6 @@ class KeystoneClient(object):
     def enable_stack_user(self, user_id):
         # FIXME : This won't work with the v3 keystone API
         self.client.users.update_enabled(user_id, True)
+
+    def url_for(self, **kwargs):
+        return self.client.service_catalog.url_for(**kwargs)
index 84f1d0f5863b12f91ec52a927ad4f3b2fc469f84..22301d5ab2300896ddc08db56a2dcc82619fbd49 100644 (file)
@@ -69,7 +69,7 @@ class OpenStackClients(object):
         return self._keystone
 
     def url_for(self, **kwargs):
-        return self.keystone().client.service_catalog.url_for(**kwargs)
+        return self.keystone().url_for(**kwargs)
 
     def nova(self, service_type='compute'):
         if service_type in self._nova:
index 124bd4d020a20853d215f512e4bc816f384caeef..0833f2fe060c58521269aaa8b0e95f8bfacd94e3 100644 (file)
@@ -133,3 +133,6 @@ class FakeKeystoneClient():
 
     def disable_stack_user(self, user_id):
         pass
+
+    def url_for(self, **kwargs):
+        return 'http://example.com:1234/v1'