[Erp5-report] r34472 luke - /erp5/trunk/utils/erp5.recipe.mysqldatabase/src/erp5/recipe/mys...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Apr 12 16:43:59 CEST 2010


Author: luke
Date: Mon Apr 12 16:43:57 2010
New Revision: 34472

URL: http://svn.erp5.org?rev=34472&view=rev
Log:
 - in case if server is not available just ignore and continue

Modified:
    erp5/trunk/utils/erp5.recipe.mysqldatabase/src/erp5/recipe/mysqldatabase/__init__.py

Modified: erp5/trunk/utils/erp5.recipe.mysqldatabase/src/erp5/recipe/mysqldatabase/__init__.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.recipe.mysqldatabase/src/erp5/recipe/mysqldatabase/__init__.py?rev=34472&r1=34471&r2=34472&view=diff
==============================================================================
--- erp5/trunk/utils/erp5.recipe.mysqldatabase/src/erp5/recipe/mysqldatabase/__init__.py [utf8] (original)
+++ erp5/trunk/utils/erp5.recipe.mysqldatabase/src/erp5/recipe/mysqldatabase/__init__.py [utf8] Mon Apr 12 16:43:57 2010
@@ -51,12 +51,17 @@
       raise zc.buildout.UserError('database_name and user are '
         'required to create database and grant privileges')
 
-    connection = MySQLdb.connect(
-      host = self.options.get('mysql_host'),
-      port = int(self.options.get('mysql_port')),
-      user = self.options.get('mysql_superuser'),
-      passwd = self.options.get('mysql_superpassword'),
-    )
+    try:
+      connection = MySQLdb.connect(
+        host = self.options.get('mysql_host'),
+        port = int(self.options.get('mysql_port')),
+        user = self.options.get('mysql_superuser'),
+        passwd = self.options.get('mysql_superpassword'),
+      )
+    except MySQLdb.OperationalError, e:
+      self.logger.warning('OperationalError %s happened during connection, '
+          'ignoring' % e)
+      return []
     connection.autocommit(0)
     cursor = connection.cursor()
 




More information about the Erp5-report mailing list