diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Bcfg2/DBSettings.py | 4 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Admin.py | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/DBSettings.py b/src/lib/Bcfg2/DBSettings.py index 80e6caf20..a0ccb18a3 100644 --- a/src/lib/Bcfg2/DBSettings.py +++ b/src/lib/Bcfg2/DBSettings.py @@ -151,6 +151,8 @@ def sync_databases(**kwargs): logger = logging.getLogger() for database in settings['DATABASES']: logger.debug("Syncing database %s" % (database)) + if django.VERSION[0] == 1 and django.VERSION[1] >= 7: + django.setup() # pylint: disable=E1101 django.core.management.call_command("syncdb", database=database, **kwargs) @@ -160,6 +162,8 @@ def migrate_databases(**kwargs): logger = logging.getLogger() for database in settings['DATABASES']: logger.debug("Migrating database %s" % (database)) + if django.VERSION[0] == 1 and django.VERSION[1] >= 7: + django.setup() # pylint: disable=E1101 django.core.management.call_command("migrate", database=database, **kwargs) diff --git a/src/lib/Bcfg2/Server/Admin.py b/src/lib/Bcfg2/Server/Admin.py index b7ee0c0ed..1b2a2fe14 100644 --- a/src/lib/Bcfg2/Server/Admin.py +++ b/src/lib/Bcfg2/Server/Admin.py @@ -905,7 +905,7 @@ if HAS_DJANGO: """ Sync the Django ORM with the configured database """ if HAS_DJANGO and django.VERSION[0] == 1 and django.VERSION[1] >= 7: - django.setup() + django.setup() # pylint: disable=E1101 def run(self, setup): Bcfg2.Server.models.load_models() @@ -1204,7 +1204,7 @@ class CLI(Bcfg2.Options.CommandRegistry): if django.VERSION[0] == 1 and django.VERSION[1] >= 7: # this has been introduced in django 1.7, so pylint fails with # older django releases - django.setup() # pylint disable=E1101 + django.setup() # pylint: disable=E1101 def run(self): """ Run bcfg2-admin """ |