diff options
-rw-r--r-- | keystoneclient/v2_0/client.py | 2 | ||||
-rw-r--r-- | keystoneclient/v2_0/users.py | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/keystoneclient/v2_0/client.py b/keystoneclient/v2_0/client.py index 0d4e685..08263a7 100644 --- a/keystoneclient/v2_0/client.py +++ b/keystoneclient/v2_0/client.py @@ -135,7 +135,7 @@ class Client(httpclient.HTTPClient): self.services = services.ServiceManager(self) self.tenants = tenants.TenantManager(self) self.tokens = tokens.TokenManager(self) - self.users = users.UserManager(self) + self.users = users.UserManager(self, self.roles) # extensions self.ec2 = ec2.CredentialsManager(self) diff --git a/keystoneclient/v2_0/users.py b/keystoneclient/v2_0/users.py index 57f036e..fcac0b5 100644 --- a/keystoneclient/v2_0/users.py +++ b/keystoneclient/v2_0/users.py @@ -35,6 +35,10 @@ class UserManager(base.ManagerWithFind): """Manager class for manipulating Keystone users.""" resource_class = User + def __init__(self, client, role_manager): + super(UserManager, self).__init__(client) + self.role_manager = role_manager + def get(self, user): return self._get("/users/%s" % base.getid(user), "user") @@ -122,5 +126,5 @@ class UserManager(base.ManagerWithFind): "users") def list_roles(self, user, tenant=None): - return self.api.roles.roles_for_user(base.getid(user), - base.getid(tenant)) + return self.role_manager.roles_for_user(base.getid(user), + base.getid(tenant)) |