[predicates] use select_or_none rather than select+try/except, expected to be more efficient
fromlogilab.common.shellutilsimportgenerate_passwordfromcubicweb.server.utilsimportcrypt_passwordforuserinrql('CWUser U WHERE U cw_source S, S name "system", U upassword P, U login L').entities():salt=user.upassword.getvalue()ifcrypt_password('',salt)==salt:passwd=generate_password()print'setting random password for user %s'%user.loginuser.set_attributes(upassword=passwd)commit()