improve PEP8ness

This commit is contained in:
Benjamin Dauvergne 2016-09-05 13:59:16 +02:00
parent 5bb324180c
commit 43b76b2ab3
1 changed files with 7 additions and 4 deletions

View File

@ -123,7 +123,8 @@ class Synchronize(object):
case_insensitive_attribute = None
def __init__(self, source, source_dn, target_conn, target_dn, attributes=None, all_filter=None,
pivot_attributes=None, logger=None, case_insensitive_attribute=None):
pivot_attributes=None, logger=None, case_insensitive_attribute=None,
objectclasses=None):
self.source = source
self.source_dn = source_dn
self.target_conn = target_conn
@ -132,7 +133,8 @@ class Synchronize(object):
self.all_filter = all_filter or self.all_filter
self.pivot_attributes = pivot_attributes or self.pivot_attributes
self.logger = logger or logging.getLogger(__name__)
self.case_insensitive_attribute = map(istr, case_insensitive_attribute or self.case_insensitive_attribute or [])
self.case_insensitive_attribute = map(istr, case_insensitive_attribute
or self.case_insensitive_attribute or [])
self.errors = []
def massage_dn(self, old_dn):
@ -212,8 +214,9 @@ class Synchronize(object):
for attribute in self.attributes:
if attribute in to_dict_of_set(entry):
new_entry[attribute] = entry[attribute]
if attribute in to_dict_of_set(out_entry) and not to_dict_of_set(entry).get(attribute):
new_entry[attribute] = []
if (attribute in to_dict_of_set(out_entry) and not
to_dict_of_set(entry).get(attribute)):
new_entry[attribute] = []
self.update(target_dn, new_entry)
else:
self.create(target_dn, entry)