[migration] fix bug in `CWAttributeAddOp.revertprecommit_event`
The `rdefdef` attribute is set during the operation execution. In some the
operation crash before this assignment. In such case `revertprecommit` raise an
attribute error crashing the whole process and shadowing the original error.
This changeset detect and Avoid this situation.
--- a/hooks/syncschema.py Thu Mar 21 18:13:31 2013 +0100
+++ b/hooks/syncschema.py Thu Mar 28 11:45:17 2013 +0100
@@ -507,6 +507,8 @@
def revertprecommit_event(self):
# revert changes on in memory schema
+ if getattr(self, 'rdefdef', None) is None:
+ return
self.session.vreg.schema.del_relation_def(
self.rdefdef.subject, self.rdefdef.name, self.rdefdef.object)
# XXX revert changes on database