summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Reporting/Storage/DjangoORM.py
diff options
context:
space:
mode:
authorMichael Fenn <fennm@deshawresearch.com>2014-03-21 15:33:30 -0400
committerMichael Fenn <fennm@deshawresearch.com>2014-03-21 15:33:30 -0400
commit78d938a0bdddf385b1e887ff0a518009ab14b154 (patch)
treef891fcb558e50de2a34eed8fa437e5c976bf172f /src/lib/Bcfg2/Reporting/Storage/DjangoORM.py
parentde02045a38f13035bb7e372d1ba1d1241e2ea4f0 (diff)
downloadbcfg2-78d938a0bdddf385b1e887ff0a518009ab14b154.tar.gz
bcfg2-78d938a0bdddf385b1e887ff0a518009ab14b154.tar.bz2
bcfg2-78d938a0bdddf385b1e887ff0a518009ab14b154.zip
Preliminary support for seperate reporting database
This commit implements a Django database router which routes each Django application to a database whose name matches a key in the database dict, falling back to the default database if no matching key is found. This support is plumbed through to the config file via database.reporting_* database connection config options. These options mirror ones available for the default database config. If database.reporting_engine is not specified in the config, then the configuration falls back to the traditional single-database way of doing things with the database router becoming a no-op.
Diffstat (limited to 'src/lib/Bcfg2/Reporting/Storage/DjangoORM.py')
-rw-r--r--src/lib/Bcfg2/Reporting/Storage/DjangoORM.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/Reporting/Storage/DjangoORM.py b/src/lib/Bcfg2/Reporting/Storage/DjangoORM.py
index c223c3c73..992687a85 100644
--- a/src/lib/Bcfg2/Reporting/Storage/DjangoORM.py
+++ b/src/lib/Bcfg2/Reporting/Storage/DjangoORM.py
@@ -380,9 +380,9 @@ class DjangoORM(StorageBase):
vrb = 1
else:
vrb = 0
- management.call_command("syncdb", verbosity=vrb, interactive=False)
- management.call_command("migrate", verbosity=vrb,
- interactive=False)
+ Bcfg2.DBSettings.sync_databases(verbosity=vrb, interactive=False)
+ Bcfg2.DBSettings.migrate_databases(verbosity=vrb,
+ interactive=False)
except:
msg = "Failed to update database schema: %s" % sys.exc_info()[1]
self.logger.error(msg)