X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sfa%2Fimporter%2Fsfa-nuke-plc.py;h=41a4598d4fa4ee6d2923b79a05fd20064288d0b2;hb=d210f49f112e71c866e79e6b62ae71c9ec0a3af1;hp=83c9e4bc703299c59dd6bc908dcb2f144f72c70c;hpb=d710b76d4d0c64f1cd16f5eb8857f8fbac1a9077;p=sfa.git diff --git a/sfa/importer/sfa-nuke-plc.py b/sfa/importer/sfa-nuke-plc.py index 83c9e4bc..41a4598d 100755 --- a/sfa/importer/sfa-nuke-plc.py +++ b/sfa/importer/sfa-nuke-plc.py @@ -13,8 +13,8 @@ from optparse import OptionParser from sfa.util.sfalogging import logger -from sfa.storage.alchemy import dbsession -from sfa.storage.model import init_tables,drop_tables +from sfa.storage.alchemy import engine +from sfa.storage.dbschema import DBSchema def main(): usage="%prog: trash the registry DB" @@ -29,14 +29,15 @@ def main(): if args: parser.print_help() sys.exit(1) + dbschema=DBSchema() logger.info("Purging SFA records from database") - drop_tables(dbsession) + dbschema.nuke() # for convenience we re-create the schema here, so there's no need for an explicit # service sfa restart # however in some (upgrade) scenarios this might be wrong if options.reinit: logger.info("re-creating empty schema") - init_tables(dbsession) + dbschema.init_or_upgrade(engine) if options.clean_certs: # remove the server certificate and all gids found in /var/lib/sfa/authorities