# HG changeset patch # User Denis Laxalde # Date 1564490845 -7200 # Node ID d59570643a49590cda858caf58b3d0cc2b9b80c8 # Parent 27ea20b1915f23513b06d023eb247f8db0e0cb2c Avoid using gone hooks_control() in migration This deprecated function got dropped in a8c1ea390400. Remove unused import in 3.10.9_Any.py migration; replace usage in bootstrapmigration_repository.py by non-deprecated form. diff -r 27ea20b1915f -r d59570643a49 cubicweb/misc/migration/3.10.9_Any.py --- a/cubicweb/misc/migration/3.10.9_Any.py Tue Jul 30 14:42:15 2019 +0200 +++ b/cubicweb/misc/migration/3.10.9_Any.py Tue Jul 30 14:47:25 2019 +0200 @@ -7,7 +7,6 @@ if confirm('fix existing cwuri?'): from logilab.common.shellutils import progress - from cubicweb.server.session import hooks_control rset = rql('Any X, XC WHERE X cwuri XC, X cwuri ~= "%/eid/%"') title = "%i entities to fix" % len(rset) nbops = rset.rowcount diff -r 27ea20b1915f -r d59570643a49 cubicweb/misc/migration/bootstrapmigration_repository.py --- a/cubicweb/misc/migration/bootstrapmigration_repository.py Tue Jul 30 14:42:15 2019 +0200 +++ b/cubicweb/misc/migration/bootstrapmigration_repository.py Tue Jul 30 14:47:25 2019 +0200 @@ -20,7 +20,6 @@ it should only include low level schema changes """ from cubicweb import ConfigurationError -from cubicweb.server.session import hooks_control from cubicweb.server import schemaserial as ss applcubicwebversion, cubicwebversion = versions_map['cubicweb'] @@ -261,7 +260,7 @@ session.set_cnxset() permsdict = ss.deserialize_ertype_permissions(session) - with hooks_control(session, session.HOOKS_ALLOW_ALL, 'integrity'): + with session.allow_all_hooks_but('integrity'): for rschema in repo.schema.relations(): rpermsdict = permsdict.get(rschema.eid, {}) for rdef in rschema.rdefs.values():