From: garciadeblas Date: Thu, 5 Mar 2020 09:31:28 +0000 (+0000) Subject: Fixed user.get to search ids, then names X-Git-Tag: v7.1.0rc1^2~18 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fosmclient.git;a=commitdiff_plain;h=ada5e9195ebaf0c67b3f6777299fe4d1e0dbeb76 Fixed user.get to search ids, then names Change-Id: I35aab8eb9d95fb29eda0168468f1e64451c2b7b5 Signed-off-by: garciadeblas --- diff --git a/osmclient/sol005/user.py b/osmclient/sol005/user.py index 660c944..1584878 100644 --- a/osmclient/sol005/user.py +++ b/osmclient/sol005/user.py @@ -214,9 +214,11 @@ class User(object): self._client.get_token() # keystone with external LDAP contains large ids, not uuid format # utils.validate_uuid4(name) cannot be used - for user in self.list(): + user_list = self.list() + for user in user_list: if name == user['_id']: return user + for user in user_list: if name == user['username']: return user raise NotFound("User {} not found".format(name))