Revision 7d95385b snf-common/synnefo/lib/db/xctx.py

b/snf-common/synnefo/lib/db/xctx.py
43 43
#     ...
44 44
#     return http response
45 45
#
46
# OR
46
# OR (more cleanly)
47 47
#
48 48
# def a_view(args):
49 49
#     with transaction_context() as ctx:
......
57 57

  
58 58

  
59 59
class TransactionContext(object):
60
    def __init__(self, notify=True):
60
    def __init__(self):
61 61
        self._rollback = False
62 62

  
63 63
    def mark_rollback(self):
......
69 69
    def postprocess(self):
70 70
        pass
71 71

  
72
class TransactionHandler(object):
73 72

  
73
class TransactionHandler(object):
74 74
    def __init__(self, ctx=None, using=None, **kwargs):
75
        self.db        = (using if using is not None
76
                          else transaction.DEFAULT_DB_ALIAS)
75
        self.db         = (using if using is not None
76
                           else transaction.DEFAULT_DB_ALIAS)
77 77
        self.ctx_class  = ctx
78 78
        self.ctx_kwargs = kwargs
79 79

  

Also available in: Unified diff