From c0ac68cd380c77c3cf1ae3c005e9ff30f57180bb Mon Sep 17 00:00:00 2001 From: Ivan Frade Date: Fri, 7 May 2010 14:02:35 +0300 Subject: data-generators: Check if the cfg file has been actually loaded --- utils/data-generators/cc/generate | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'utils') diff --git a/utils/data-generators/cc/generate b/utils/data-generators/cc/generate index 99e3ce053..8776d060c 100755 --- a/utils/data-generators/cc/generate +++ b/utils/data-generators/cc/generate @@ -30,9 +30,14 @@ if len(sys.argv) != 2: config = ConfigParser.RawConfigParser() try: - config.read(sys.argv[1]) + loaded_files = config.read(sys.argv[1]) except: - print "Failed to read configuration file %s", sys.argv[1] + print "Failed to read configuration file %s" % (sys.argv[1]) + sys.exit (-1) + +if (len(loaded_files) != 1): + print "Cannot open %s" % (sys.argv[1]) + sys.exit (-1) # set up all known types tools.addType( 'nco#EmailAddress', 10 ) -- cgit v1.2.1