[Neo-report] r2430 gregory - in /trunk/neo: master/pt.py pt.py

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Nov 8 11:24:25 CET 2010


Author: gregory
Date: Mon Nov  8 11:24:25 2010
New Revision: 2430

Log:
Any change on cells return the diff applied on the partition table.

Modified:
    trunk/neo/master/pt.py
    trunk/neo/pt.py

Modified: trunk/neo/master/pt.py
==============================================================================
--- trunk/neo/master/pt.py [iso-8859-1] (original)
+++ trunk/neo/master/pt.py [iso-8859-1] Mon Nov  8 11:24:25 2010
@@ -137,15 +137,14 @@ class PartitionTable(neo.pt.PartitionTab
             raise PartitionTableException('Non-assigned partition')
 
         # update the partition table
-        self.setCell(offset, node, CellStates.UP_TO_DATE)
+        cell_list = [self.setCell(offset, node, CellStates.UP_TO_DATE)]
         cell_list = [(offset, uuid, CellStates.UP_TO_DATE)]
 
         # If the partition contains a feeding cell, drop it now.
         for feeding_cell in self.getCellList(offset):
             if feeding_cell.isFeeding():
-                self.removeCell(offset, feeding_cell.getNode())
-                cell = (offset, feeding_cell.getUUID(), CellStates.DISCARDED)
-                cell_list.append(cell)
+                cell_list.append(self.removeCell(offset,
+                    feeding_cell.getNode()))
                 break
 
         return cell_list

Modified: trunk/neo/pt.py
==============================================================================
--- trunk/neo/pt.py [iso-8859-1] (original)
+++ trunk/neo/pt.py [iso-8859-1] Mon Nov  8 11:24:25 2010
@@ -183,6 +183,7 @@ class PartitionTable(object):
             row.append(Cell(node, state))
             if state != CellStates.FEEDING:
                 self.count_dict[node] += 1
+        return (offset, node.getUUID(), state)
 
     def removeCell(self, offset, node):
         row = self.partition_list[offset]
@@ -193,6 +194,7 @@ class PartitionTable(object):
                 if not cell.isFeeding():
                     self.count_dict[node] -= 1
                 break
+        return (offset, node.getUUID(), CellStates.DISCARDED)
 
     def load(self, ptid, row_list, nm):
         """





More information about the Neo-report mailing list