[Treepkg-commits] r351 - branches/treepkg-status/treepkg

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jul 8 18:08:39 CEST 2010


Author: bricks
Date: 2010-07-08 18:08:39 +0200 (Thu, 08 Jul 2010)
New Revision: 351

Modified:
   branches/treepkg-status/treepkg/readconfig.py
Log:
check if config file exists to get usefull error output


Modified: branches/treepkg-status/treepkg/readconfig.py
===================================================================
--- branches/treepkg-status/treepkg/readconfig.py	2010-07-08 16:00:32 UTC (rev 350)
+++ branches/treepkg-status/treepkg/readconfig.py	2010-07-08 16:08:39 UTC (rev 351)
@@ -9,6 +9,7 @@
 
 import sys
 import shlex
+import os.path
 from ConfigParser import SafeConfigParser, NoOptionError
 
 import util
@@ -125,6 +126,9 @@
     configuration of the tree packager.  The packagers list contains one
     dict with the configuratiin for each packager.
     """
+    if not os.path.exists(filename):
+        print >>sys.stderr, "Config file %s does not exist" % filename
+        sys.exit(2)
     parser = SafeConfigParser()
     parser.read([filename])
 



More information about the Treepkg-commits mailing list