Mercurial > treepkg
changeset 391:89ecca5d262e treepkg-status
check if config file exists to get usefull error output
author | Bjoern Ricks <bricks@intevation.de> |
---|---|
date | Thu, 08 Jul 2010 16:08:39 +0000 |
parents | 6cab748288f7 |
children | e2afbd3c2bf1 |
files | treepkg/readconfig.py |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/treepkg/readconfig.py Thu Jul 08 16:00:32 2010 +0000 +++ b/treepkg/readconfig.py Thu Jul 08 16:08:39 2010 +0000 @@ -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])