From bd12f736a1ec1258c38e958935915e3cb1709646 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Thu, 23 Mar 2006 19:44:12 +0000 Subject: * Print error message and exit if no component location information exists in the config file (fixes Ticket #34) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1809 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/bcfg2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2 index 5b9270595..5afa9d7e5 100755 --- a/src/sbin/bcfg2 +++ b/src/sbin/bcfg2 @@ -7,7 +7,11 @@ from ConfigParser import ConfigParser, NoSectionError, NoOptionError from lxml.etree import Element, XML, tostring, XMLSyntaxError import getopt, logging, os, signal, sys, tempfile, time, traceback, xmlrpclib -import Bcfg2.Client.Proxy, Bcfg2.Logging +try: + import Bcfg2.Client.Proxy, Bcfg2.Logging +except KeyError: + print "Could not read options from configuration file" + raise SystemExit, 1 def cb_sigint_handler(signum, frame): '''Exit upon CTRL-C''' -- cgit v1.2.3-1-g7c22