PEP8 fixes

Change-Id: I957311f7e2f371217d8812c7319b87623e8972e9
This commit is contained in:
Dolph Mathews 2012-06-01 10:03:34 -05:00 committed by Joe Heck
parent 1349e12735
commit 4bfa203ac4
4 changed files with 5 additions and 5 deletions

View File

@ -17,7 +17,7 @@
class DictKvs(dict):
def set(self, key, value):
if type(value) is type({}):
if isinstance(value, dict):
self[key] = value.copy()
else:
self[key] = value[:]
@ -33,6 +33,6 @@ class Base(object):
def __init__(self, db=None):
if db is None:
db = INMEMDB
elif type(db) is type({}):
elif isinstance(db, dict):
db = DictKvs(db)
self.db = db

View File

@ -79,7 +79,7 @@ class BaseLdap(object):
if self.options_name is not None:
self.suffix = conf.ldap.suffix
if (self.suffix == None):
if self.suffix is None:
self.suffix = self.DEFAULT_SUFFIX
dn = '%s_tree_dn' % self.options_name
self.tree_dn = (getattr(conf.ldap, dn)

View File

@ -420,7 +420,7 @@ class UserController(wsgi.Application):
user_ref = self.identity_api.update_user(context, user_id, user)
# If the password was changed or the user was disabled we clear tokens
if user.get('password') or user.get('enabled', True) == False:
if user.get('password') or not user.get('enabled', True):
try:
for token_id in self.token_api.list_tokens(context, user_id):
self.token_api.delete_token(context, token_id)

View File

@ -31,7 +31,7 @@ def parse_mailmap(mailmap='.mailmap'):
for l in fp:
l = l.strip()
if not l.startswith('#') and ' ' in l:
canonical_email, alias = [x for x in l.split(' ') \
canonical_email, alias = [x for x in l.split(' ')
if x.startswith('<')]
mapping[alias] = canonical_email
return mapping