summaryrefslogtreecommitdiffstats
path: root/nova/auth
diff options
context:
space:
mode:
authorRyan Lane <laner@controller>2010-12-08 00:34:20 +0000
committerRyan Lane <laner@controller>2010-12-08 00:34:20 +0000
commit9fdff2a0f0b45d7ddf1df58f83ac723fc8d99532 (patch)
treeff4772340f0ca3be97a356f221c615873c0ae07c /nova/auth
parent70371ab447bff6af36f12ad9594eb6ffdbff4396 (diff)
downloadnova-9fdff2a0f0b45d7ddf1df58f83ac723fc8d99532.tar.gz
nova-9fdff2a0f0b45d7ddf1df58f83ac723fc8d99532.tar.xz
nova-9fdff2a0f0b45d7ddf1df58f83ac723fc8d99532.zip
More pep8 fixes to remove deprecated functions
Diffstat (limited to 'nova/auth')
-rw-r--r--nova/auth/ldapdriver.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/nova/auth/ldapdriver.py b/nova/auth/ldapdriver.py
index 9baf45c92..c10939d74 100644
--- a/nova/auth/ldapdriver.py
+++ b/nova/auth/ldapdriver.py
@@ -138,19 +138,19 @@ class LdapDriver(object):
# Entry could be malformed, test for missing attrs.
# Malformed entries are useless, replace attributes found.
attr = []
- if user.has_key('secretKey'):
+ if 'secretKey' in user.keys():
attr.append((self.ldap.MOD_REPLACE, 'secretKey', \
[secret_key]))
else:
attr.append((self.ldap.MOD_ADD, 'secretKey', \
[secret_key]))
- if user.has_key('accessKey'):
+ if 'accessKey' in user.keys():
attr.append((self.ldap.MOD_REPLACE, 'accessKey', \
[access_key]))
else:
attr.append((self.ldap.MOD_ADD, 'accessKey', \
[access_key]))
- if user.has_key('isAdmin'):
+ if 'isAdmin' in user.keys():
attr.append((self.ldap.MOD_REPLACE, 'isAdmin', \
[str(is_admin).upper()]))
else:
@@ -298,13 +298,13 @@ class LdapDriver(object):
attr = []
# Retrieve user by name
user = self.__get_ldap_user(uid)
- if user.has_key('secretKey'):
+ if 'secretKey' in user.keys():
attr.append((self.ldap.MOD_DELETE, 'secretKey', \
user['secretKey']))
- if user.has_key('accessKey'):
+ if 'accessKey' in user.keys():
attr.append((self.ldap.MOD_DELETE, 'accessKey', \
user['accessKey']))
- if user.has_key('isAdmin'):
+ if 'isAdmin' in user.keys():
attr.append((self.ldap.MOD_DELETE, 'isAdmin', \
user['isAdmin']))
self.conn.modify_s(self.__uid_to_dn(uid), attr)
@@ -513,8 +513,8 @@ class LdapDriver(object):
"""Convert ldap attributes to User object"""
if attr is None:
return None
- if (attr.has_key('accessKey') and attr.has_key('secretKey') \
- and attr.has_key('isAdmin')):
+ if ('accessKey' in attr.keys() and 'secretKey' in attr.keys() \
+ and 'isAdmin' in attr.keys()):
return {
'id': attr['uid'][0],
'name': attr['cn'][0],