Commit 66cd62e9 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Remove trailing whitespaces.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1530 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent face448b
...@@ -75,7 +75,7 @@ class IdentificationHandler(MasterHandler): ...@@ -75,7 +75,7 @@ class IdentificationHandler(MasterHandler):
conn.setUUID(uuid) conn.setUUID(uuid)
conn.setHandler(handler) conn.setHandler(handler)
# answer # answer
args = (NodeTypes.MASTER, app.uuid, app.pt.getPartitions(), args = (NodeTypes.MASTER, app.uuid, app.pt.getPartitions(),
app.pt.getReplicas(), uuid) app.pt.getReplicas(), uuid)
conn.answer(Packets.AcceptIdentification(*args), packet.getId()) conn.answer(Packets.AcceptIdentification(*args), packet.getId())
# trigger the event # trigger the event
......
...@@ -43,7 +43,7 @@ class StorageServiceHandler(BaseServiceHandler): ...@@ -43,7 +43,7 @@ class StorageServiceHandler(BaseServiceHandler):
def askLastIDs(self, conn, packet): def askLastIDs(self, conn, packet):
app = self.app app = self.app
conn.answer(Packets.AnswerLastIDs(app.loid, app.tm.getLastTID(), conn.answer(Packets.AnswerLastIDs(app.loid, app.tm.getLastTID(),
app.pt.getID()), packet.getId()) app.pt.getID()), packet.getId())
def askUnfinishedTransactions(self, conn, packet): def askUnfinishedTransactions(self, conn, packet):
...@@ -62,7 +62,7 @@ class StorageServiceHandler(BaseServiceHandler): ...@@ -62,7 +62,7 @@ class StorageServiceHandler(BaseServiceHandler):
# transaction locked on this storage node # transaction locked on this storage node
t = self.app.tm[tid] t = self.app.tm[tid]
if not t.lock(uuid): if not t.lock(uuid):
return return
# all nodes are locked # all nodes are locked
......
...@@ -59,7 +59,7 @@ class Transaction(object): ...@@ -59,7 +59,7 @@ class Transaction(object):
""" """
Returns the list of OIDs used in the transaction Returns the list of OIDs used in the transaction
""" """
return list(self._oid_list) return list(self._oid_list)
def prepare(self, oid_list, uuid_list, msg_id): def prepare(self, oid_list, uuid_list, msg_id):
...@@ -88,7 +88,7 @@ class Transaction(object): ...@@ -88,7 +88,7 @@ class Transaction(object):
class TransactionManager(object): class TransactionManager(object):
""" """
Manage current transactions Manage current transactions
""" """
...@@ -157,7 +157,7 @@ class TransactionManager(object): ...@@ -157,7 +157,7 @@ class TransactionManager(object):
self._node_dict = {} self._node_dict = {}
def hasPending(self): def hasPending(self):
""" """
Returns True if some transactions are pending Returns True if some transactions are pending
""" """
return bool(self._tid_dict) return bool(self._tid_dict)
......
...@@ -58,7 +58,7 @@ class IdentificationHandler(BaseStorageHandler): ...@@ -58,7 +58,7 @@ class IdentificationHandler(BaseStorageHandler):
conn.setHandler(handler) conn.setHandler(handler)
conn.setUUID(uuid) conn.setUUID(uuid)
node.setUUID(uuid) node.setUUID(uuid)
args = (NodeTypes.STORAGE, app.uuid, app.pt.getPartitions(), args = (NodeTypes.STORAGE, app.uuid, app.pt.getPartitions(),
app.pt.getReplicas(), uuid) app.pt.getReplicas(), uuid)
# accept the identification and trigger an event # accept the identification and trigger an event
conn.answer(Packets.AcceptIdentification(*args), packet.getId()) conn.answer(Packets.AcceptIdentification(*args), packet.getId())
......
...@@ -49,9 +49,9 @@ class ClientTests(NEOFunctionalTest): ...@@ -49,9 +49,9 @@ class ClientTests(NEOFunctionalTest):
def setUp(self): def setUp(self):
NEOFunctionalTest.setUp(self) NEOFunctionalTest.setUp(self)
self.neo = NEOCluster( self.neo = NEOCluster(
['test_neo1'], ['test_neo1'],
port_base=20000, port_base=20000,
master_node_count=1, master_node_count=1,
temp_dir=self.getTempDirectory() temp_dir=self.getTempDirectory()
) )
......
...@@ -617,8 +617,8 @@ class MasterServerElectionTests(NeoTestBase): ...@@ -617,8 +617,8 @@ class MasterServerElectionTests(NeoTestBase):
""" Check with a non-master node, must be refused """ """ Check with a non-master node, must be refused """
conn = self.__getClient() conn = self.__getClient()
packet = protocol.RequestIdentification( packet = protocol.RequestIdentification(
NodeTypes.CLIENT, NodeTypes.CLIENT,
conn.getUUID(), conn.getUUID(),
conn.getAddress(), conn.getAddress(),
name=self.app.name, name=self.app.name,
) )
...@@ -632,7 +632,7 @@ class MasterServerElectionTests(NeoTestBase): ...@@ -632,7 +632,7 @@ class MasterServerElectionTests(NeoTestBase):
name=self.app.name name=self.app.name
) )
def testRequestIdentification2(self): def testRequestIdentification2(self):
""" Check with an unknown master node """ """ Check with an unknown master node """
conn = self.__getMaster(register=False) conn = self.__getMaster(register=False)
packet = protocol.RequestIdentification( packet = protocol.RequestIdentification(
......
...@@ -157,7 +157,7 @@ class MasterRecoveryTests(NeoTestBase): ...@@ -157,7 +157,7 @@ class MasterRecoveryTests(NeoTestBase):
offset = 1000000 offset = 1000000
self.assertFalse(self.app.pt.hasOffset(offset)) self.assertFalse(self.app.pt.hasOffset(offset))
cell_list = [(offset, ((uuid, NodeStates.DOWN,),),)] cell_list = [(offset, ((uuid, NodeStates.DOWN,),),)]
self.checkProtocolErrorRaised(recovery.answerPartitionTable, conn, self.checkProtocolErrorRaised(recovery.answerPartitionTable, conn,
packet, None, cell_list) packet, None, cell_list)
......
...@@ -53,9 +53,9 @@ class MasterStorageHandlerTests(NeoTestBase): ...@@ -53,9 +53,9 @@ class MasterStorageHandlerTests(NeoTestBase):
return self.port return self.port
def _getClient(self): def _getClient(self):
return self.identifyToMasterNode(node_type=NodeTypes.CLIENT, return self.identifyToMasterNode(node_type=NodeTypes.CLIENT,
ip='127.0.0.1', port=self._allocatePort()) ip='127.0.0.1', port=self._allocatePort())
def _getStorage(self): def _getStorage(self):
return self.identifyToMasterNode(node_type=NodeTypes.STORAGE, return self.identifyToMasterNode(node_type=NodeTypes.STORAGE,
ip='127.0.0.1', port=self._allocatePort()) ip='127.0.0.1', port=self._allocatePort())
...@@ -105,7 +105,7 @@ class MasterStorageHandlerTests(NeoTestBase): ...@@ -105,7 +105,7 @@ class MasterStorageHandlerTests(NeoTestBase):
oid_list = self.getOID(), self.getOID() oid_list = self.getOID(), self.getOID()
msg_id = 1 msg_id = 1
# a faked event manager # a faked event manager
connection_list = [client_conn_1, client_conn_2, storage_conn_1, connection_list = [client_conn_1, client_conn_2, storage_conn_1,
storage_conn_2] storage_conn_2]
self.app.em = Mock({"getConnectionList" : connection_list}) self.app.em = Mock({"getConnectionList" : connection_list})
# register a transaction # register a transaction
......
...@@ -108,7 +108,7 @@ class testTransactionManager(NeoTestBase): ...@@ -108,7 +108,7 @@ class testTransactionManager(NeoTestBase):
tid1 = txnman.begin(node1, None) tid1 = txnman.begin(node1, None)
self.assertTrue(tid1 is not None) self.assertTrue(tid1 is not None)
self.assertEqual(txnman.getLastTID(), tid1) self.assertEqual(txnman.getLastTID(), tid1)
# set a new last TID # set a new last TID
ntid = pack('!Q', unpack('!Q', tid1)[0] + 10) ntid = pack('!Q', unpack('!Q', tid1)[0] + 10)
txnman.setLastTID(ntid) txnman.setLastTID(ntid)
self.assertEqual(txnman.getLastTID(), ntid) self.assertEqual(txnman.getLastTID(), ntid)
......
...@@ -66,7 +66,7 @@ def resolve(hostname): ...@@ -66,7 +66,7 @@ def resolve(hostname):
except socket.gaierror: except socket.gaierror:
return None return None
return address_list[0] return address_list[0]
def parseMasterList(masters, except_node=None): def parseMasterList(masters, except_node=None):
if not masters: if not masters:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment