direct-io.hg

changeset 7418:6ef7386f7370

Protect __del__ from failure inside __init__ by setting inTransaction before
trying to create a transaction instance.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Tue Oct 18 18:07:11 2005 +0100 (2005-10-18)
parents c24fae1cd39d
children bd1298cf0b4d
files tools/python/xen/xend/xenstore/xstransact.py
line diff
     1.1 --- a/tools/python/xen/xend/xenstore/xstransact.py	Tue Oct 18 18:01:14 2005 +0100
     1.2 +++ b/tools/python/xen/xend/xenstore/xstransact.py	Tue Oct 18 18:07:11 2005 +0100
     1.3 @@ -14,6 +14,9 @@ from xen.xend.xenstore.xsutil import xsh
     1.4  class xstransact:
     1.5  
     1.6      def __init__(self, path):
     1.7 +        self.in_transaction = False # Set this temporarily -- if this
     1.8 +                                    # constructor fails, then we need to
     1.9 +                                    # protect __del__.
    1.10          self.path = path.rstrip("/")
    1.11          self.transaction = xshandle().transaction_start()
    1.12          self.in_transaction = True