summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/DBSettings.py
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'options-unit-tests' of https://github.com/stpierre/bcfg2Alexander Sulfrian2014-11-101-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'options-unit-tests' of https://github.com/stpierre/bcfg2: Options: Fixed non-path database name parsing Options: further command registry fixes Options: gather as much data from config file first Options: fix path canonicalization and file-like objects testsuite: unlink temporary files Options: ensure <repository> macros are always fixed up DBSettings: fix up <repository> in database name testsuite: better debug capturing for options tests call shutdown on subcommand registries fixed some places where plugin loading should fail silently testsuite: Added unit tests for new option parsing testsuite: capture stderr by default Test failure to parse config file when bcfg2.conf exists testsuite: skip nested exclusive option group test on py2.6 testsuite: Added unit tests for new option parsing
| * Options: Fixed non-path database name parsingChris St. Pierre2014-11-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The database name is sometimes a path (SQLite) and sometimes not (MySQL, PostgreSQL). This introduces a new Option type, RepositoryMacroOption, that expands <repository> macros without canonicalizing the path, so SQLite users can use <repository> in their settings but MySQL users' database name settings will not be destroyed by path canonicalization. The unfortunate downside is that SQLite users can't use ~ in their database name.
| * DBSettings: fix up <repository> in database nameChris St. Pierre2014-10-221-1/+1
| |
* | Fix missing import line for django.core.management.Matt Kemp2014-10-281-0/+1
|/
* Fix admins and managers in django configMatt Kemp2014-06-121-2/+2
| | | This should eventually be a configurable.
* Merge branch 'maint'Chris St. Pierre2014-04-251-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | Conflicts: misc/bcfg2.spec src/lib/Bcfg2/Client/Client.py src/lib/Bcfg2/Client/Tools/APK.py src/lib/Bcfg2/Client/Tools/MacPorts.py src/lib/Bcfg2/Client/Tools/Pacman.py src/lib/Bcfg2/Client/Tools/YUM.py src/lib/Bcfg2/Server/Admin/Minestruct.py src/lib/Bcfg2/Server/Admin/Pull.py src/lib/Bcfg2/Server/Admin/Viz.py src/lib/Bcfg2/Server/Core.py src/lib/Bcfg2/Server/Plugins/Cfg/CfgEncryptedGenerator.py src/lib/Bcfg2/Server/Plugins/Cfg/CfgPrivateKeyCreator.py src/lib/Bcfg2/Server/Plugins/Properties.py src/lib/Bcfg2/settings.py src/sbin/bcfg2-crypt src/sbin/bcfg2-info src/sbin/bcfg2-lint src/sbin/bcfg2-yum-helper testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgEncryptedGenerator.py testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProperties.py
* Reporting: update non-ORM bits to know about separate databaseMichael Fenn2014-04-091-5/+12
| | | | | | | | | There is a little bit of code in the reporting web interface that uses raw SQL rather than the django ORM. This bypassed the database router functionality (since there is no model to bind to). Django supports keeping track of multiple connections in the raw SQL interface, so this commit does the refactoring necessary to support the multiple databases.
* Be more robust about checking for reporting_db_engine presenceMichael Fenn2014-03-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This matters during the test suite: ====================================================================== ERROR: Failure: AttributeError ('Namespace' object has no attribute 'reporting_db_engine') ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.6/site-packages/nose/loader.py", line 364, in loadTestsFromName addr.filename, addr.module) File "/usr/lib/python2.6/site-packages/nose/importer.py", line 39, in importFromPath return self.importFromDir(dir_path, fqname) File "/usr/lib/python2.6/site-packages/nose/importer.py", line 84, in importFromDir mod = load_module(part_fqname, fh, filename, desc) File "/d/en/fennm-0/bcfg2-dbrouter/bcfg2-dbrouter.git/testsuite/Testtools/__init__.py", line 14, in <module> from common import * File "/d/en/fennm-0/bcfg2-dbrouter/bcfg2-dbrouter.git/testsuite/common.py", line 62, in <module> Bcfg2.DBSettings.finalize_django_config() File "/d/en/fennm-0/bcfg2-dbrouter/bcfg2-dbrouter.git/src/lib/Bcfg2/DBSettings.py", line 99, in finalize_django_config if opts.reporting_db_engine is not None: AttributeError: 'Namespace' object has no attribute 'reporting_db_engine'
* Make indentation consistent with other elements of the dictMichael Fenn2014-03-241-1/+1
|
* Preliminary support for seperate reporting databaseMichael Fenn2014-03-211-1/+94
| | | | | | | | | | | | | 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.
* DBSettings: Set config options at the module levelChris St. Pierre2014-03-051-0/+3
| | | | | Some bits of Django appear to query the options directly from the module, even if django.conf.settings.configure() has been called
* Merge branch 'maint'Chris St. Pierre2013-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/appendix/guides/fedora.txt misc/bcfg2.spec schemas/types.xsd src/lib/Bcfg2/Encryption.py src/lib/Bcfg2/Options.py src/lib/Bcfg2/Server/Admin/Client.py src/lib/Bcfg2/Server/Core.py src/lib/Bcfg2/Server/Lint/Validate.py src/lib/Bcfg2/Server/Plugin/helpers.py src/lib/Bcfg2/Server/Plugins/Bundler.py src/lib/Bcfg2/Server/Plugins/Cfg/CfgEncryptedGenerator.py src/lib/Bcfg2/Server/Plugins/Probes.py src/sbin/bcfg2-crypt testsuite/Testsrc/Testlib/TestServer/TestPlugin/Testhelpers.py testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestCfg/TestCfgEncryptedGenerator.py testsuite/Testsrc/Testlib/TestServer/TestPlugins/TestProbes.py testsuite/common.py testsuite/install.sh
* DB: fixed how Django settings are loadedChris St. Pierre2013-10-301-0/+178