aboutsummaryrefslogtreecommitdiff
path: root/gitosis
diff options
context:
space:
mode:
authorTommi Virtanen <tv@inoi.fi>2007-08-11 16:26:24 -0700
committerTommi Virtanen <tv@eagain.net>2007-08-11 17:28:52 -0700
commit92476622f7cdd415eecc16f8af44d9126e369e0c (patch)
treed1ee4fccbaf347482a19160ac42e7e281fcb1d95 /gitosis
parentAllow repository names to start with numericals. (diff)
downloadgitosis-dakkar-92476622f7cdd415eecc16f8af44d9126e369e0c.tar.gz
gitosis-dakkar-92476622f7cdd415eecc16f8af44d9126e369e0c.tar.bz2
gitosis-dakkar-92476622f7cdd415eecc16f8af44d9126e369e0c.zip
Fail if gitosis-serve can't read the config file.
Diffstat (limited to 'gitosis')
-rw-r--r--gitosis/serve.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/gitosis/serve.py b/gitosis/serve.py
index b0f4b9c..496f942 100644
--- a/gitosis/serve.py
+++ b/gitosis/serve.py
@@ -66,7 +66,15 @@ def main():
die("Command to run looks dangerous")
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('~'))