mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
Protect __del__ from failure inside __init__ by setting inTransaction before
trying to create a transaction instance. Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
1 parent
ac6e05c769
commit
a1190ad2e6
1 file changed
+3
@@ -14,6 +14,9 @@ from xen.xend.xenstore.xsutil import xshandle
|
||||
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
|
||||
|
||||