[node-patches] Change in ovirt-node[master]: utils: Fix nested transactons

fabiand at fedoraproject.org fabiand at fedoraproject.org
Wed Feb 26 12:03:07 UTC 2014


Fabian Deutsch has uploaded a new change for review.

Change subject: utils: Fix nested transactons
......................................................................

utils: Fix nested transactons

Change-Id: I6f364902e7321a72b6f58552d99074dbe7682b1d
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M src/ovirt/node/utils/__init__.py
1 file changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/71/25071/1

diff --git a/src/ovirt/node/utils/__init__.py b/src/ovirt/node/utils/__init__.py
index bfd8ebe..11cfaf1 100644
--- a/src/ovirt/node/utils/__init__.py
+++ b/src/ovirt/node/utils/__init__.py
@@ -221,11 +221,11 @@
 
     elements = None
 
-    def __init__(self, title, elements=[]):
+    def __init__(self, title, elements=None):
         super(Transaction, self).__init__()
         self.title = title
         self._prepared_elements = []
-        self.elements = elements
+        self.elements = elements or []
 
     def prepare(self):
         self._prepared_elements = []
@@ -289,6 +289,12 @@
     def __iter__(self):
         return self.elements.__iter__()
 
+    def append(self, value):
+        self.elements.append(value)
+
+    def extend(self, iterable):
+        self.elements.extend(iterable)
+
     def step(self):
         try:
             with lockfile.FileLock(self._lockfilename):


-- 
To view, visit http://gerrit.ovirt.org/25071
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f364902e7321a72b6f58552d99074dbe7682b1d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list