summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib/Component.py2
-rwxr-xr-xsrc/sbin/bcfg2-server4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/Component.py b/src/lib/Component.py
index 33ed635af..1a4c35d02 100644
--- a/src/lib/Component.py
+++ b/src/lib/Component.py
@@ -24,7 +24,7 @@ class NoExposedMethod (Exception):
"""There is no method exposed with the given name."""
def run_component(component_cls, location, daemon, pidfile_name, to_file,
- cfile='/etc/bcfg2.conf', argv=None, register=True,
+ cfile, argv=None, register=True,
state_name=False, cls_kwargs={}, extra_getopt='', time_out=10,
protocol='xmlrpc/ssl', certfile=None, keyfile=None, ca=None):
diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server
index 5c058bc2a..73802965e 100755
--- a/src/sbin/bcfg2-server
+++ b/src/sbin/bcfg2-server
@@ -4,6 +4,7 @@
__revision__ = '$Revision$'
import logging
+import os.path
import sys
import Bcfg2.Logger
@@ -45,6 +46,9 @@ if __name__ == '__main__':
setup = Bcfg2.Options.OptionParser(OPTINFO)
setup.parse(sys.argv[1:])
try:
+ # check whether the specified bcfg2.conf exists
+ if not os.path.exists(setup['configfile']):
+ raise CoreInitError, "Could not read %s" % setup['configfile']
Bcfg2.Component.run_component(Bcfg2.Server.Core.Core,
location=setup['location'],
daemon = setup['daemon'],