Lines 312-317
def samaccountname_dn_mapping
|
Link Here
|
---|
|
312 |
|
312 |
|
313 |
if s4connector.property[propertyname].mapping_table and propertyattrib in s4connector.property[propertyname].mapping_table.keys(): |
313 |
if s4connector.property[propertyname].mapping_table and propertyattrib in s4connector.property[propertyname].mapping_table.keys(): |
314 |
for ucsval, conval in s4connector.property[propertyname].mapping_table[propertyattrib]: |
314 |
for ucsval, conval in s4connector.property[propertyname].mapping_table[propertyattrib]: |
|
|
315 |
if ucsval == "Printer-Admins": |
316 |
continue |
315 |
try: |
317 |
try: |
316 |
if value.lower() == ucsval.lower(): |
318 |
if value.lower() == ucsval.lower(): |
317 |
value = conval |
319 |
value = conval |
|
2409 |
try: |
2411 |
try: |
2410 |
self.lo_s4.lo.add_ext_s(compatible_modstring(object['dn']), compatible_addlist(addlist), serverctrls=ctrls) # FIXME encoding |
2412 |
self.lo_s4.lo.add_ext_s(compatible_modstring(object['dn']), compatible_addlist(addlist), serverctrls=ctrls) # FIXME encoding |
2411 |
except ldap.ALREADY_EXISTS as ex: |
2413 |
except ldap.ALREADY_EXISTS as ex: |
2412 |
sAMAccountName_attr_value = object['attributes'].get('sAMAccountName', [None])[0] |
2414 |
sAMAccountName = object['attributes'].get('sAMAccountName', [None])[0] |
2413 |
objectSid_attr_value = object['attributes'].get('objectSid', [None])[0] |
2415 |
sambaSID = object['attributes'].get('sambaSID', [None])[0] |
2414 |
objectSid = decode_sid(objectSid_attr_value) |
2416 |
if not (sAMAccountName and sambaSID): |
2415 |
if not (sAMAccountName_attr_value and objectSid): |
|
|
2416 |
raise # unknown situation, raise original traceback |
2417 |
raise # unknown situation, raise original traceback |
2417 |
filter_s4 = '(&(sAMAccountName=%s)(objectSid=%s)(isDeleted=TRUE))' % (sAMAccountName_attr_value, objectSid) |
2418 |
filter_s4 = '(&(sAMAccountName=%s)(objectSid=%s)(isDeleted=TRUE))' % (sAMAccountName, sambaSID) |
2418 |
ud.debug(ud.LDAP, ud.PROCESS, "sync_from_ucs: error during add, searching for conflicting deleted object in S4") |
2419 |
ud.debug(ud.LDAP, ud.PROCESS, "sync_from_ucs: error during add, searching for conflicting deleted object in S4") |
2419 |
ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: search filter: %s" % filter_s4) |
2420 |
ud.debug(ud.LDAP, ud.INFO, "sync_from_ucs: search filter: %s" % filter_s4) |
2420 |
result = self.lo_s4.lo.search_ext_s(self.lo_s4.base, ldap.SCOPE_SUBTREE, filter_s4, ['dn'], serverctrls=[LDAPControl( |
2421 |
result = self.lo_s4.lo.search_ext_s(self.lo_s4.base, ldap.SCOPE_SUBTREE, filter_s4, ['dn'], serverctrls=[LDAPControl( |