[yum-cvs] yum/yum __init__.py,1.196.2.4,1.196.2.5

Seth Vidal skvidal at linux.duke.edu
Mon May 8 15:38:10 UTC 2006


Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv23941/yum

Modified Files:
      Tag: yum-2_6_X
	__init__.py 
Log Message:

catch parsing error and raise a ConfigError. helps rh bug #191013


Index: __init__.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/__init__.py,v
retrieving revision 1.196.2.4
retrieving revision 1.196.2.5
diff -u -r1.196.2.4 -r1.196.2.5
--- __init__.py	26 Apr 2006 15:47:40 -0000	1.196.2.4
+++ __init__.py	8 May 2006 15:38:08 -0000	1.196.2.5
@@ -131,8 +131,12 @@
             if os.path.isdir(reposdir):
                 #XXX: why can't we just pass the list of files?
                 files = ' '.join(glob.glob('%s/*.repo' % reposdir))
-                #XXX: error catching here
-                parser.read(files)
+
+                try:
+                    parser.read(files)
+                except ConfigParser.ParsingError, e:
+                    msg = str(e)
+                    raise Errors.ConfigError, msg
 
         # Check sections in the .repo files that were just slurped up
         for section in parser.sections():




More information about the Yum-cvs-commits mailing list