diff options
author | Jamie Lennox <jamielennox@redhat.com> | 2014-07-04 09:09:18 +1000 |
---|---|---|
committer | Jamie Lennox <jamielennox@redhat.com> | 2014-11-21 08:03:23 +1000 |
commit | b0e68b06b3c5da2da4307bd172708317d8b0428c (patch) | |
tree | 9223b536f6111b8625e02a994bb439ceb033e9c4 /keystoneclient/v2_0 | |
parent | b71a0a22c54e91a1c0058e4b29973df4154478f6 (diff) | |
download | python-keystoneclient-b0e68b06b3c5da2da4307bd172708317d8b0428c.tar.gz |
Make keystoneclient use an adapter
Apart from making keystoneclient follow the same patterns of using an
adapter that we are trying to push onto other clients this severs the
cyclical dependency between managers and the client object.
There are a few changes that have had to be rolled into one to make the
transition work. These can't be separated unfortunately as they are
interdependent.
* managers are now passed the adapter instead of the client. They
therefore don't have reference to the other managers on the client.
* The adapter has been subclassed to provide user_id as there are some
managers that require user_id be provided for changing passwords etc.
* client.auth_url has been replaced with a call to get_endpoint which is
supported by the adapter.
* management=True has been removed from all the managers and they now
correctly set the interface they want.
Change-Id: I49fbd50571f0c1484e1cbc3dcb2159d25b21b1bc
Diffstat (limited to 'keystoneclient/v2_0')
-rw-r--r-- | keystoneclient/v2_0/client.py | 18 | ||||
-rw-r--r-- | keystoneclient/v2_0/users.py | 2 |
2 files changed, 11 insertions, 9 deletions
diff --git a/keystoneclient/v2_0/client.py b/keystoneclient/v2_0/client.py index dc790e8..f7bf153 100644 --- a/keystoneclient/v2_0/client.py +++ b/keystoneclient/v2_0/client.py @@ -130,17 +130,19 @@ class Client(httpclient.HTTPClient): def __init__(self, **kwargs): """Initialize a new client for the Keystone v2.0 API.""" super(Client, self).__init__(**kwargs) - self.endpoints = endpoints.EndpointManager(self) - self.extensions = extensions.ExtensionManager(self) - self.roles = roles.RoleManager(self) - self.services = services.ServiceManager(self) - self.tokens = tokens.TokenManager(self) - self.users = users.UserManager(self, self.roles) - self.tenants = tenants.TenantManager(self, self.roles, self.users) + self.endpoints = endpoints.EndpointManager(self._adapter) + self.extensions = extensions.ExtensionManager(self._adapter) + self.roles = roles.RoleManager(self._adapter) + self.services = services.ServiceManager(self._adapter) + self.tokens = tokens.TokenManager(self._adapter) + self.users = users.UserManager(self._adapter, self.roles) + + self.tenants = tenants.TenantManager(self._adapter, + self.roles, self.users) # extensions - self.ec2 = ec2.CredentialsManager(self) + self.ec2 = ec2.CredentialsManager(self._adapter) # DEPRECATED: if session is passed then we go to the new behaviour of # authenticating on the first required call. diff --git a/keystoneclient/v2_0/users.py b/keystoneclient/v2_0/users.py index df488f5..11e06f3 100644 --- a/keystoneclient/v2_0/users.py +++ b/keystoneclient/v2_0/users.py @@ -78,7 +78,7 @@ class UserManager(base.ManagerWithFind): return self._update("/OS-KSCRUD/users/%s" % self.api.user_id, params, response_key="access", method="PATCH", - management=False, + endpoint_filter={'interface': 'public'}, log=False) def update_tenant(self, user, tenant): |