summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2017-12-01 23:22:13 +0000
committerGerrit Code Review <review@openstack.org>2017-12-01 23:22:13 +0000
commitc06eea8edd78e5a6148907ce47cbd02ac5072e24 (patch)
tree558e709f402f1a27927e54da0dcd5e4372dc5c33
parent8f0dfab5b5724db0be46d1c816a96d254735a199 (diff)
parent4d0276d9d964c8420e550d7846b8a0b2930bb5ba (diff)
Merge "Unuse an undefined local variable 'name'."
-rw-r--r--trove/tests/util/users.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/trove/tests/util/users.py b/trove/tests/util/users.py
index 7492907..c8ef5e4 100644
--- a/trove/tests/util/users.py
+++ b/trove/tests/util/users.py
@@ -118,7 +118,7 @@ class Users(object):
118 try: 118 try:
119 user = min(users, key=lambda user: user.test_count) 119 user = min(users, key=lambda user: user.test_count)
120 except ValueError: 120 except ValueError:
121 raise RuntimeError('Did not find a user with name "%s".' % name) 121 raise RuntimeError('Did not find a user with specified condition')
122 user.test_count += 1 122 user.test_count += 1
123 return user 123 return user
124 124
@@ -128,5 +128,6 @@ class Users(object):
128 return self._find_user_by_condition(condition) 128 return self._find_user_by_condition(condition)
129 129
130 def find_user_by_tenant_id(self, tenant_id): 130 def find_user_by_tenant_id(self, tenant_id):
131 """Finds a user who meets the requirements and has been used least."""
131 condition = lambda user: user.tenant_id == tenant_id 132 condition = lambda user: user.tenant_id == tenant_id
132 return self._find_user_by_condition(condition) 133 return self._find_user_by_condition(condition)