[Neo-report] r2202 vincent - /trunk/neo/storage/handlers/master.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Aug 19 12:01:26 CEST 2010


Author: vincent
Date: Thu Aug 19 12:01:24 2010
New Revision: 2202

Log:
Move test for replicator presence out of loop.

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

Modified: trunk/neo/storage/handlers/master.py
==============================================================================
--- trunk/neo/storage/handlers/master.py [iso-8859-1] (original)
+++ trunk/neo/storage/handlers/master.py [iso-8859-1] Thu Aug 19 12:01:24 2010
@@ -44,13 +44,14 @@ class MasterOperationHandler(BaseMasterH
         app.dm.changePartitionTable(ptid, cell_list)
 
         # Check changes for replications
-        for offset, uuid, state in cell_list:
-            if uuid == app.uuid and app.replicator is not None:
-                # If this is for myself, this can affect replications.
-                if state == CellStates.DISCARDED:
-                    app.replicator.removePartition(offset)
-                elif state == CellStates.OUT_OF_DATE:
-                    app.replicator.addPartition(offset)
+        if app.replicator is not None:
+            for offset, uuid, state in cell_list:
+                if uuid == app.uuid:
+                    # If this is for myself, this can affect replications.
+                    if state == CellStates.DISCARDED:
+                        app.replicator.removePartition(offset)
+                    elif state == CellStates.OUT_OF_DATE:
+                        app.replicator.addPartition(offset)
 
     def askLockInformation(self, conn, tid, oid_list):
         if not tid in self.app.tm:





More information about the Neo-report mailing list