[csw-devel] SF.net SVN: gar:[18164] csw/mgar/gar/v2/lib/python/configuration.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Wed May 30 00:25:30 CEST 2012


Revision: 18164
          http://gar.svn.sourceforge.net/gar/?rev=18164&view=rev
Author:   wahwah
Date:     2012-05-29 22:25:30 +0000 (Tue, 29 May 2012)
Log Message:
-----------
pkgdb-configuration: Log files that have been read

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/configuration.py

Modified: csw/mgar/gar/v2/lib/python/configuration.py
===================================================================
--- csw/mgar/gar/v2/lib/python/configuration.py	2012-05-29 22:24:35 UTC (rev 18163)
+++ csw/mgar/gar/v2/lib/python/configuration.py	2012-05-29 22:25:30 UTC (rev 18164)
@@ -72,6 +72,7 @@
 def GetConfig():
   config = ConfigParser.SafeConfigParser()
   file_was_found = False
+  filenames_read = []
   for file_name_tmpl, default_file in CONFIGURATION_FILE_LOCATIONS:
     filename = None
     try:
@@ -79,7 +80,9 @@
       if os.path.exists(filename):
         if not default_file:
           file_was_found = True
-        config.read(file_name_tmpl % os.environ)
+        filename_found = file_name_tmpl % os.environ
+        filenames_read.append(filename_found)
+        config.read(filename_found)
     except KeyError, e:
       logging.warn(e)
   if not file_was_found:
@@ -105,9 +108,10 @@
       fd.close()
       logging.debug("Configuration has been written.")
   if not config.has_section("database"):
-    logging.fatal("Section 'database' not found in the config file. "
+    logging.fatal(
+        "Section 'database' not found in the config files: %s. "
         "Please refer to the documentation: "
-        "http://wiki.opencsw.org/checkpkg")
+        "http://wiki.opencsw.org/checkpkg" % filenames_read)
     raise SystemExit
   return config
 

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list