diff options
Diffstat (limited to 'src/lib/Bcfg2/Options.py')
-rw-r--r-- | src/lib/Bcfg2/Options.py | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Options.py b/src/lib/Bcfg2/Options.py index fe1bad110..fb36a985b 100644 --- a/src/lib/Bcfg2/Options.py +++ b/src/lib/Bcfg2/Options.py @@ -224,6 +224,7 @@ def get_bool(s): return False else: raise ValueError + """ Options: @@ -424,6 +425,32 @@ SERVER_BACKEND = \ default='best', cf=('server', 'backend')) +# database options +DB_ENGINE = \ + Option('Database engine', + default='django.db.backends.sqlite3', + cf=('database', 'engine')) +DB_NAME = \ + Option('Database name', + default=os.path.join(SERVER_REPOSITORY.default, "bcfg2.sqlite"), + cf=('database', 'name')) +DB_USER = \ + Option('Database username', + default=None, + cf=('database', 'user')) +DB_PASSWORD = \ + Option('Database password', + default=None, + cf=('database', 'password')) +DB_HOST = \ + Option('Database host', + default='localhost', + cf=('database', 'host')) +DB_PORT = \ + Option('Database port', + default='', + cf=('database', 'port'),) + # Client options CLIENT_KEY = \ Option('Path to SSL key', @@ -898,12 +925,15 @@ class OptionParser(OptionSet): OptionParser bootstraps option parsing, getting the value of the config file """ - def __init__(self, args, argv=None): + def __init__(self, args, argv=None, quiet=False): if argv is None: argv = sys.argv[1:] + # the bootstrap is always quiet, since it's running with a + # default config file and so might produce warnings otherwise self.Bootstrap = OptionSet([('configfile', CFILE)], quiet=True) self.Bootstrap.parse(argv, do_getopt=False) - OptionSet.__init__(self, args, configfile=self.Bootstrap['configfile']) + OptionSet.__init__(self, args, configfile=self.Bootstrap['configfile'], + quiet=quiet) self.optinfo = copy.copy(args) def HandleEvent(self, event): |