[Neo-report] r2359 vincent - /trunk/neo/storage/handlers/initialization.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Oct 29 11:36:59 CEST 2010


Author: vincent
Date: Fri Oct 29 11:36:59 2010
New Revision: 2359

Log:
Slight simplification.

Modified:
    trunk/neo/storage/handlers/initialization.py

Modified: trunk/neo/storage/handlers/initialization.py
==============================================================================
--- trunk/neo/storage/handlers/initialization.py [iso-8859-1] (original)
+++ trunk/neo/storage/handlers/initialization.py [iso-8859-1] Fri Oct 29 11:36:59 2010
@@ -40,14 +40,13 @@ class InitializationHandler(BaseMasterHa
         # Install the partition table into the database for persistency.
         cell_list = []
         num_partitions = app.pt.getPartitions()
-        assigned_set = set()
+        unassigned_set = set(xrange(num_partitions))
         for offset in xrange(num_partitions):
             for cell in pt.getCellList(offset):
                 cell_list.append((offset, cell.getUUID(), cell.getState()))
                 if cell.getUUID() == app.uuid:
-                    assigned_set.add(offset)
+                    assigned_set.remove(offset)
         # delete objects database
-        unassigned_set = list(set(xrange(num_partitions)) - assigned_set)
         if unassigned_set:
             logging.debug('drop data for partitions %r' % unassigned_set)
             app.dm.dropPartitions(num_partitions, unassigned_set)





More information about the Neo-report mailing list