ldapuser2ldapfeed: create CWUsers with random passwords, not empty ones stable
authorJulien Cristau <julien.cristau@logilab.fr>
Fri, 31 Aug 2012 12:52:45 +0200
branchstable
changeset 8521 dfdffebce8a4
parent 8520 fcd048fa6e6d
child 8522 85b1c4b36d1d
ldapuser2ldapfeed: create CWUsers with random passwords, not empty ones
misc/scripts/ldapuser2ldapfeed.py
--- a/misc/scripts/ldapuser2ldapfeed.py	Fri Aug 31 16:58:08 2012 +0200
+++ b/misc/scripts/ldapuser2ldapfeed.py	Fri Aug 31 12:52:45 2012 +0200
@@ -4,6 +4,7 @@
 """
 import sys
 from collections import defaultdict
+from logilab.common.shellutils import generate_password
 
 try:
     source_name, = __args__
@@ -57,7 +58,7 @@
     if not entity.modification_date:
         entity.cw_edited['modification_date'] = datetime.now()
     if not entity.upassword:
-        entity.cw_edited['upassword'] = u''
+        entity.cw_edited['upassword'] = generate_password()
     extid = entity.cw_metainformation()['extid']
     if not entity.cwuri:
         entity.cw_edited['cwuri'] = '%s/?dn=%s' % (