summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Admin
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-28 15:32:11 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-28 15:32:11 -0400
commit6895b400192b0fe5343d89f8a92cd7e7eef23a07 (patch)
tree80552d374f95fbc6eff5e3455f7bbcb9b817d1a6 /src/lib/Bcfg2/Server/Admin
parent0549e87e44fca8e586cd03c5e1dc9875e1f9b5fd (diff)
downloadbcfg2-6895b400192b0fe5343d89f8a92cd7e7eef23a07.tar.gz
bcfg2-6895b400192b0fe5343d89f8a92cd7e7eef23a07.tar.bz2
bcfg2-6895b400192b0fe5343d89f8a92cd7e7eef23a07.zip
Bcfg2.settings: Fixed config file reading:
* If -W is given on the command line, the config file given by -W is read. * If /etc/bcfg2-web.conf does not exist, and -C was given on the command line, the config file given by -C is read. * If /etc/bcfg2-web.conf does not exist and -C was not given on the command line, the default /etc/bcfg2.conf is read. * If /etc/bcfg2-web.conf exists, and neither -W nor -C was given on the command line, then /etc/bcfg2-web.conf is read. This will produce errors if: * A bogus (non-existent, unreadable) file was given by -W; or * A bogus file was given by -C and /etc/bcfg2-web.conf does not exist; or * No -W was given and /etc/bcfg2-web.conf exists but is unreadable; or * No -W was given, /etc/bcfg2-web.conf does not exist, and /etc/bcfg2.conf is bogus.
Diffstat (limited to 'src/lib/Bcfg2/Server/Admin')
-rw-r--r--src/lib/Bcfg2/Server/Admin/Syncdb.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/lib/Bcfg2/Server/Admin/Syncdb.py b/src/lib/Bcfg2/Server/Admin/Syncdb.py
index bff232b05..1eb953e2a 100644
--- a/src/lib/Bcfg2/Server/Admin/Syncdb.py
+++ b/src/lib/Bcfg2/Server/Admin/Syncdb.py
@@ -8,8 +8,7 @@ class Syncdb(Bcfg2.Server.Admin.Mode):
__shorthelp__ = ("Sync the Django ORM with the configured database")
__longhelp__ = __shorthelp__ + "\n\nbcfg2-admin syncdb"
__usage__ = "bcfg2-admin syncdb"
- options = {'web_configfile': Bcfg2.Options.WEB_CFILE,
- 'repo': Bcfg2.Options.SERVER_REPOSITORY}
+ options = {'configfile': Bcfg2.Options.WEB_CFILE}
def __call__(self, args):
import Bcfg2.Server.Admin
@@ -19,12 +18,6 @@ class Syncdb(Bcfg2.Server.Admin.Mode):
self.opts = Bcfg2.Options.OptionParser(self.options)
self.opts.parse(args)
- # we have to set up the django environment before we import
- # the syncdb command, but we have to wait to set up the
- # environment until we've read the config, which has to wait
- # until we've parsed options. it's a windy, twisting road.
- Bcfg2.settings.read_config(cfile=self.opts['web_configfile'],
- repo=self.opts['repo'])
setup_environ(Bcfg2.settings)
import Bcfg2.Server.models
Bcfg2.Server.models.load_models(cfile=self.opts['configfile'])