equal
deleted
inserted
replaced
15 for eid, extid in sql("SELECT eid, extid FROM entities WHERE source='%s'" % uri): |
15 for eid, extid in sql("SELECT eid, extid FROM entities WHERE source='%s'" % uri): |
16 olduserdn = b64decode(extid) |
16 olduserdn = b64decode(extid) |
17 newuserdn = olduserdn.replace(olddn, newdn) |
17 newuserdn = olduserdn.replace(olddn, newdn) |
18 if newuserdn != olduserdn: |
18 if newuserdn != olduserdn: |
19 print olduserdn, '->', newuserdn |
19 print olduserdn, '->', newuserdn |
20 sql("UPDATE entities SET extid='%s' WHERE eid=%s" % (b64encode(newdn), eid)) |
20 sql("UPDATE entities SET extid='%s' WHERE eid=%s" % (b64encode(newuserdn), eid)) |
21 |
21 |
22 commit() |
22 commit() |
23 |
23 |
24 print 'you can now update the sources file to the new dn and restart the instance' |
24 print 'you can now update the sources file to the new dn and restart the instance' |