Move url_for into heat_keystoneclient.

This allows faking of this call, and removes one instance of
accessing the encapsulated keystone client.

Change-Id: Iad2a9aaad2e9f1dc3cbeb509c822a61427f12817
This commit is contained in:
Steve Baker 2013-07-17 14:30:58 +12:00
parent 808e34ee15
commit b02b826083
3 changed files with 7 additions and 1 deletions

View 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)

View 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:

View 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'