diff options
| author | Justin Santa Barbara <justin@fathomdb.com> | 2011-03-18 10:14:42 -0700 |
|---|---|---|
| committer | Justin Santa Barbara <justin@fathomdb.com> | 2011-03-18 10:14:42 -0700 |
| commit | ee09125e31a3afe64f0a9540a88fdb5febd7ddd4 (patch) | |
| tree | 5f743db2a482579d0a7d44a23ee40d6989794562 /nova | |
| parent | 4f5dc6314f9dd7bb136a38fa07b109eb2e12734d (diff) | |
| download | nova-ee09125e31a3afe64f0a9540a88fdb5febd7ddd4.tar.gz nova-ee09125e31a3afe64f0a9540a88fdb5febd7ddd4.tar.xz nova-ee09125e31a3afe64f0a9540a88fdb5febd7ddd4.zip | |
Avoid single-letter variable names
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/tests/api/openstack/fakes.py | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/nova/tests/api/openstack/fakes.py b/nova/tests/api/openstack/fakes.py index 020682093..9b5ed8a15 100644 --- a/nova/tests/api/openstack/fakes.py +++ b/nova/tests/api/openstack/fakes.py @@ -255,21 +255,21 @@ class FakeAuthManager(object): return FakeAuthManager.auth_data def get_user(self, uid): - for u in FakeAuthManager.auth_data: - if u.id == uid: - return u + for user in FakeAuthManager.auth_data: + if user.id == uid: + return user return None def get_user_from_access_key(self, key): - for u in FakeAuthManager.auth_data: - if u.access == key: - return u + for user in FakeAuthManager.auth_data: + if user.access == key: + return user return None def delete_user(self, uid): - for u in FakeAuthManager.auth_data: - if u.id == uid: - FakeAuthManager.auth_data.remove(u) + for user in FakeAuthManager.auth_data: + if user.id == uid: + FakeAuthManager.auth_data.remove(user) return None def create_user(self, name, access=None, secret=None, admin=False): @@ -278,10 +278,7 @@ class FakeAuthManager(object): return u def modify_user(self, user_id, access=None, secret=None, admin=None): - user = None - for u in FakeAuthManager.auth_data: - if u.id == user_id: - user = u + user = self.get_user(user_id) if user: user.access = access user.secret = secret |
