diff options
Diffstat (limited to 'rpki/rpkic.py')
-rw-r--r-- | rpki/rpkic.py | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/rpki/rpkic.py b/rpki/rpkic.py index 417c53fe..0e485200 100644 --- a/rpki/rpkic.py +++ b/rpki/rpkic.py @@ -128,35 +128,7 @@ class main(Cmd): self.histfile = cfg.get("history_file", os.path.expanduser("~/.rpkic_history")) self.autosync = cfg.getboolean("autosync", True, section = "rpkic") - # This should go away now that we have rpki.django_settings, but - # let's get a verbose log with it present first to see what - # changes. - - use_south = True - setup_db = False - - if use_south: - os.environ.update(DJANGO_SETTINGS_MODULE = "rpki.django_settings") - - else: - import django - from django.conf import settings - settings.configure( - DATABASES = { "default" : { - "ENGINE" : "django.db.backends.mysql", - "NAME" : cfg.get("sql-database", section = "irdbd"), - "USER" : cfg.get("sql-username", section = "irdbd"), - "PASSWORD" : cfg.get("sql-password", section = "irdbd"), - "HOST" : "", - "PORT" : "", - "OPTIONS" : { "init_command": "SET storage_engine=INNODB" }}}, - INSTALLED_APPS = ("rpki.irdb",), - MIDDLEWARE_CLASSES = (), # API change, feh - ) - - if django.VERSION >= (1, 7): # API change, feh - from django.apps import apps - apps.populate(settings.INSTALLED_APPS) + os.environ.update(DJANGO_SETTINGS_MODULE = "rpki.django_settings.irdb") import rpki.irdb # pylint: disable=W0621 @@ -178,12 +150,15 @@ class main(Cmd): except rpki.config.ConfigParser.Error: pass - if setup_db: + # Need to figure out whether we really want rpkic setting up + # databases or not. Defer until we've caught up to a current + # version of Django, are past the change from South to Django + # 1.7+'s migration scheme, and other potential complications. + + if False: import django.core.management django.core.management.call_command("syncdb", verbosity = 3, load_initial_data = False) - - if setup_db and use_south: - django.core.management.call_command("migrate", verbosity = 3) + django.core.management.call_command("migrate", verbosity = 3) self.zoo = rpki.irdb.Zookeeper(cfg = cfg, handle = self.handle, logstream = sys.stdout) |