[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Protect __del__ from failure inside __init__ by setting inTransaction before



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 6ef7386f7370dc4a7b314acedb410e29aa8450c0
# Parent  c24fae1cd39d21d39ec0144b4fd0b9a1f396e073
Protect __del__ from failure inside __init__ by setting inTransaction before
trying to create a transaction instance.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r c24fae1cd39d -r 6ef7386f7370 
tools/python/xen/xend/xenstore/xstransact.py
--- a/tools/python/xen/xend/xenstore/xstransact.py      Tue Oct 18 17:01:14 2005
+++ b/tools/python/xen/xend/xenstore/xstransact.py      Tue Oct 18 17:07:11 2005
@@ -14,6 +14,9 @@
 class xstransact:
 
     def __init__(self, path):
+        self.in_transaction = False # Set this temporarily -- if this
+                                    # constructor fails, then we need to
+                                    # protect __del__.
         self.path = path.rstrip("/")
         self.transaction = xshandle().transaction_start()
         self.in_transaction = True

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.