コード例 #1
0
ファイル: migrate.py プロジェクト: ferhatelmas/indico
def localIdentityMigration(dbi, withRBDB, prevVersion):
    """Generate the new password with a salt"""

    auth = LocalAuthenticator()
    total = len(auth.getList())
    for i, identity in enumerate(auth.getList()):
        print '\r  Processing %d/%d' % (i + 1, total),
        if not hasattr(identity, 'algorithm'):
            identity.setPassword(identity.password)
        if i % 1000 == 999:
            dbi.commit()
    print
    dbi.commit()
コード例 #2
0
ファイル: migrate.py プロジェクト: Json-Andriopoulos/indico
def localIdentityMigration(dbi, withRBDB, prevVersion):
    """Generate the new password with a salt"""

    auth = LocalAuthenticator()
    total = len(auth.getList())
    for i, identity in enumerate(auth.getList()):
        print '\r  Processing %d/%d' % (i + 1, total),
        if not hasattr(identity, 'algorithm'):
            identity.setPassword(identity.password)
        if i % 1000 == 999:
            dbi.commit()
    print
    dbi.commit()