[CalendarServer-changes] [11330] CalendarServer/trunk/txdav/common/datastore/upgrade/sql/upgrades/ util.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Jun 12 08:29:33 PDT 2013


Revision: 11330
          http://trac.calendarserver.org//changeset/11330
Author:   cdaboo at apple.com
Date:     2013-06-12 08:29:33 -0700 (Wed, 12 Jun 2013)
Log Message:
-----------
Better error logging for failed upgrades.

Modified Paths:
--------------
    CalendarServer/trunk/txdav/common/datastore/upgrade/sql/upgrades/util.py

Modified: CalendarServer/trunk/txdav/common/datastore/upgrade/sql/upgrades/util.py
===================================================================
--- CalendarServer/trunk/txdav/common/datastore/upgrade/sql/upgrades/util.py	2013-06-12 15:28:40 UTC (rev 11329)
+++ CalendarServer/trunk/txdav/common/datastore/upgrade/sql/upgrades/util.py	2013-06-12 15:29:33 UTC (rev 11330)
@@ -15,11 +15,15 @@
 ##
 
 from twext.enterprise.dal.syntax import Select, Delete, Update
+from twext.python.log import Logger
 from twisted.internet.defer import inlineCallbacks, returnValue
 from txdav.base.propertystore.base import PropertyName
+from txdav.base.propertystore.sql import PropertyStore
 from txdav.common.datastore.sql_tables import schema
-from txdav.base.propertystore.sql import PropertyStore
+from twisted.python.failure import Failure
 
+log = Logger()
+
 @inlineCallbacks
 def rowsForProperty(txn, propelement, with_uid=False, batch=None):
     pname = PropertyName.fromElement(propelement)
@@ -143,5 +147,8 @@
                 Where=homeSchema.RESOURCE_ID == homeResourceID,
             ).on(txn)
             yield txn.commit()
-        except RuntimeError:
+        except RuntimeError, e:
+            f = Failure()
+            log.error("Failed to upgrade %s to %s: %s" % (homeSchema, version, e))
             yield txn.abort()
+            f.raiseException()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130612/98abd6ad/attachment-0001.html>


More information about the calendarserver-changes mailing list