[mirrorbrain-commits] r7886 - /trunk/mirrordoctor/mb/conf.py

From: <poeml_at_mirrorbrain.org>
Date: Tue, 01 Dec 2009 19:07:46 -0000
Author: poeml
Date: Tue Dec  1 20:07:44 2009
New Revision: 7886

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=7886&view=rev
Log:
mb: catch parse errors in the configuration file, and report them nicely

Modified:
    trunk/mirrordoctor/mb/conf.py

Modified: trunk/mirrordoctor/mb/conf.py
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mirrordoctor/mb/conf.py?rev=7886&r1=7885&r2=7886&view=diff
==============================================================================
--- trunk/mirrordoctor/mb/conf.py (original)
+++ trunk/mirrordoctor/mb/conf.py Tue Dec  1 20:07:44 2009
@@ -1,4 +1,5 @@
 
+import sys
 import ConfigParser
 import re
 
@@ -22,7 +23,11 @@
         self.mirrorprobe = {}
 
         cp = ConfigParser.SafeConfigParser()
-        cp.read(conffile)
+        try:
+            cp.read(conffile)
+        except ConfigParser.ParsingError, e:
+            print e
+            sys.exit(2)
 
         #
         # take care of the [general] section




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Tue Dec 01 2009 - 19:07:49 GMT

This archive was generated by hypermail 2.2.0 : Tue Dec 01 2009 - 19:45:23 GMT