diff options
author | Tommi Virtanen <tv@inoi.fi> | 2007-08-11 16:26:24 -0700 |
---|---|---|
committer | Tommi Virtanen <tv@eagain.net> | 2007-08-11 17:28:52 -0700 |
commit | 92476622f7cdd415eecc16f8af44d9126e369e0c (patch) | |
tree | d1ee4fccbaf347482a19160ac42e7e281fcb1d95 /gitosis | |
parent | Allow repository names to start with numericals. (diff) | |
download | gitosis-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.py | 10 |
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('~')) |