From: Peter Palfrader Date: Thu, 11 Mar 2010 21:23:35 +0000 (+0100) Subject: Probably should only delete keyFingerPrint if it exists X-Git-Tag: userdir-ldap-0.3.77~22 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=d2388a189d5c4c80c8272e511fd8c95d4dc2fbc8 Probably should only delete keyFingerPrint if it exists --- diff --git a/ud-lock b/ud-lock index bfde9f8..6d56ddb 100755 --- a/ud-lock +++ b/ud-lock @@ -122,9 +122,9 @@ def do_one_user(lc, user, ticket): print ' %s: %s'%(key, set[key]) rec.append( (ldap.MOD_REPLACE, key, set[key]) ) - print ' %s: deleting keyFingerPrint'%(user) - rec.append( (ldap.MOD_DELETE, 'keyFingerPrint', None) ) - + if u.numkeys() > 0: + print ' %s: deleting keyFingerPrint'%(user) + rec.append( (ldap.MOD_DELETE, 'keyFingerPrint', None) ) if dry_run: print '(not committing)'