misc/scripts/repair_file_1-9_migration.py
branchstable
changeset 7056 51f88f13d6f3
parent 6109 47d9c0e0f7b7
child 8694 d901c36bcfce
equal deleted inserted replaced
7055:a393ebb880cd 7056:51f88f13d6f3
    17 from cubicweb.server.session import hooks_control
    17 from cubicweb.server.session import hooks_control
    18 
    18 
    19 sourcescfg = repo.config.sources()
    19 sourcescfg = repo.config.sources()
    20 backupcfg = cwconfig.instance_configuration(backupinstance)
    20 backupcfg = cwconfig.instance_configuration(backupinstance)
    21 backupcfg.repairing = True
    21 backupcfg.repairing = True
    22 backuprepo, backupcnx = dbapi.in_memory_cnx(backupcfg, sourcescfg['admin']['login'],
    22 backuprepo, backupcnx = dbapi.in_memory_repo_cnx(backupcfg, sourcescfg['admin']['login'],
    23                                             password=sourcescfg['admin']['password'],
    23                                                  password=sourcescfg['admin']['password'],
    24                                             host='localhost')
    24                                                  host='localhost')
    25 backupcu = backupcnx.cursor()
    25 backupcu = backupcnx.cursor()
    26 
    26 
    27 with hooks_control(session, session.HOOKS_DENY_ALL):
    27 with hooks_control(session, session.HOOKS_DENY_ALL):
    28     rql('SET X is Y WHERE X is File, Y name "File", NOT X is Y')
    28     rql('SET X is Y WHERE X is File, Y name "File", NOT X is Y')
    29     rql('SET X is_instance_of Y WHERE X is File, Y name "File", NOT X is_instance_of Y')
    29     rql('SET X is_instance_of Y WHERE X is File, Y name "File", NOT X is_instance_of Y')