Fail if gitosis-serve can't read the config file.

This commit is contained in:
Tommi Virtanen 2007-08-11 16:26:24 -07:00 committed by Tommi Virtanen
parent f2bc82f877
commit 92476622f7

View file

@ -66,7 +66,15 @@ def main():
die("Command to run looks dangerous") die("Command to run looks dangerous")
cfg = RawConfigParser() cfg = RawConfigParser()
cfg.read(options.config) try:
conffile = file(options.config)
except (IOError, OSError), e:
# I trust the exception has the path.
die("Unable to read config file: %s." % e)
try:
cfg.readfp(conffile)
finally:
conffile.close()
os.chdir(os.path.expanduser('~')) os.chdir(os.path.expanduser('~'))