Commit f82331fc authored by Grégory Wisniewski's avatar Grégory Wisniewski

Rename UnlockInformation to NotifyUnlockInformation.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1490 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent d3f3067e
...@@ -234,7 +234,7 @@ class EventHandler(object): ...@@ -234,7 +234,7 @@ class EventHandler(object):
def invalidateObjects(self, conn, packet, oid_list, tid): def invalidateObjects(self, conn, packet, oid_list, tid):
raise UnexpectedPacketError raise UnexpectedPacketError
def unlockInformation(self, conn, packet, tid): def notifyUnlockInformation(self, conn, packet, tid):
raise UnexpectedPacketError raise UnexpectedPacketError
def askStoreObject(self, conn, packet, oid, serial, def askStoreObject(self, conn, packet, oid, serial,
...@@ -402,7 +402,7 @@ class EventHandler(object): ...@@ -402,7 +402,7 @@ class EventHandler(object):
d[Packets.LockInformation] = self.lockInformation d[Packets.LockInformation] = self.lockInformation
d[Packets.NotifyInformationLocked] = self.notifyInformationLocked d[Packets.NotifyInformationLocked] = self.notifyInformationLocked
d[Packets.InvalidateObjects] = self.invalidateObjects d[Packets.InvalidateObjects] = self.invalidateObjects
d[Packets.UnlockInformation] = self.unlockInformation d[Packets.NotifyUnlockInformation] = self.notifyUnlockInformation
d[Packets.AskNewOIDs] = self.askNewOIDs d[Packets.AskNewOIDs] = self.askNewOIDs
d[Packets.AnswerNewOIDs] = self.answerNewOIDs d[Packets.AnswerNewOIDs] = self.answerNewOIDs
d[Packets.AskStoreObject] = self.askStoreObject d[Packets.AskStoreObject] = self.askStoreObject
......
...@@ -152,7 +152,7 @@ class PacketLogger(EventHandler): ...@@ -152,7 +152,7 @@ class PacketLogger(EventHandler):
def invalidateObjects(self, conn, packet, oid_list, tid): def invalidateObjects(self, conn, packet, oid_list, tid):
pass pass
def unlockInformation(self, conn, packet, tid): def notifyUnlockInformation(self, conn, packet, tid):
pass pass
def askStoreObject(self, conn, packet, oid, serial, def askStoreObject(self, conn, packet, oid, serial,
......
...@@ -86,7 +86,7 @@ class StorageServiceHandler(BaseServiceHandler): ...@@ -86,7 +86,7 @@ class StorageServiceHandler(BaseServiceHandler):
c.notify(Packets.InvalidateObjects(t.getOIDList(), tid)) c.notify(Packets.InvalidateObjects(t.getOIDList(), tid))
elif node.isStorage(): elif node.isStorage():
if uuid in t.getUUIDList(): if uuid in t.getUUIDList():
c.notify(Packets.UnlockInformation(tid)) c.notify(Packets.NotifyUnlockInformation(tid))
# remove transaction from manager # remove transaction from manager
self.app.tm.remove(tid) self.app.tm.remove(tid)
......
...@@ -697,7 +697,7 @@ class InvalidateObjects(Packet): ...@@ -697,7 +697,7 @@ class InvalidateObjects(Packet):
oid_list.append(oid) oid_list.append(oid)
return (oid_list, tid) return (oid_list, tid)
class UnlockInformation(Packet): class NotifyUnlockInformation(Packet):
""" """
Unlock information on a transaction. PM -> S. Unlock information on a transaction. PM -> S.
""" """
...@@ -1297,7 +1297,7 @@ class PacketRegistry(dict): ...@@ -1297,7 +1297,7 @@ class PacketRegistry(dict):
LockInformation = register(0x0014, LockInformation) LockInformation = register(0x0014, LockInformation)
NotifyInformationLocked = register(0x8014, NotifyInformationLocked) NotifyInformationLocked = register(0x8014, NotifyInformationLocked)
InvalidateObjects = register(0x0015, InvalidateObjects) InvalidateObjects = register(0x0015, InvalidateObjects)
UnlockInformation = register(0x0016, UnlockInformation) NotifyUnlockInformation = register(0x0016, NotifyUnlockInformation)
AskNewOIDs = register(0x0017, AskNewOIDs) AskNewOIDs = register(0x0017, AskNewOIDs)
AnswerNewOIDs = register(0x8017, AnswerNewOIDs) AnswerNewOIDs = register(0x8017, AnswerNewOIDs)
AskStoreObject = register(0x0018, AskStoreObject) AskStoreObject = register(0x0018, AskStoreObject)
......
...@@ -109,7 +109,7 @@ class HiddenHandler(BaseMasterHandler): ...@@ -109,7 +109,7 @@ class HiddenHandler(BaseMasterHandler):
def lockInformation(self, conn, packet, tid): def lockInformation(self, conn, packet, tid):
pass pass
def unlockInformation(self, conn, packet, tid): def notifyUnlockInformation(self, conn, packet, tid):
pass pass
def askObject(self, conn, packet, oid, serial, tid): def askObject(self, conn, packet, oid, serial, tid):
......
...@@ -69,7 +69,7 @@ class MasterOperationHandler(BaseMasterHandler): ...@@ -69,7 +69,7 @@ class MasterOperationHandler(BaseMasterHandler):
pass pass
conn.answer(Packets.NotifyInformationLocked(tid), packet.getId()) conn.answer(Packets.NotifyInformationLocked(tid), packet.getId())
def unlockInformation(self, conn, packet, tid): def notifyUnlockInformation(self, conn, packet, tid):
app = self.app app = self.app
try: try:
t = app.transaction_dict[tid] t = app.transaction_dict[tid]
......
...@@ -274,8 +274,8 @@ class NeoTestBase(unittest.TestCase): ...@@ -274,8 +274,8 @@ class NeoTestBase(unittest.TestCase):
def checkLockInformation(self, conn, **kw): def checkLockInformation(self, conn, **kw):
return self.checkAskPacket(conn, Packets.LockInformation, **kw) return self.checkAskPacket(conn, Packets.LockInformation, **kw)
def checkUnlockInformation(self, conn, **kw): def checkNotifyUnlockInformation(self, conn, **kw):
return self.checkNotifyPacket(conn, Packets.UnlockInformation, **kw) return self.checkNotifyPacket(conn, Packets.NotifyUnlockInformation, **kw)
def checkRequestIdentification(self, conn, **kw): def checkRequestIdentification(self, conn, **kw):
return self.checkAskPacket(conn, Packets.RequestIdentification, **kw) return self.checkAskPacket(conn, Packets.RequestIdentification, **kw)
......
...@@ -123,8 +123,8 @@ class MasterStorageHandlerTests(NeoTestBase): ...@@ -123,8 +123,8 @@ class MasterStorageHandlerTests(NeoTestBase):
self.service.notifyInformationLocked(storage_conn_2, packet, tid) self.service.notifyInformationLocked(storage_conn_2, packet, tid)
self.checkAnswerTransactionFinished(client_conn_1) self.checkAnswerTransactionFinished(client_conn_1)
self.checkInvalidateObjects(client_conn_2) self.checkInvalidateObjects(client_conn_2)
self.checkUnlockInformation(storage_conn_1) self.checkNotifyUnlockInformation(storage_conn_1)
self.checkUnlockInformation(storage_conn_2) self.checkNotifyUnlockInformation(storage_conn_2)
def test_12_askLastIDs(self): def test_12_askLastIDs(self):
service = self.service service = self.service
......
...@@ -164,7 +164,7 @@ class StorageMasterHandlerTests(NeoTestBase): ...@@ -164,7 +164,7 @@ class StorageMasterHandlerTests(NeoTestBase):
self.operation.lockInformation(conn, packet, '\x01' * 8) self.operation.lockInformation(conn, packet, '\x01' * 8)
self.checkNotifyInformationLocked(conn, answered_packet=packet) self.checkNotifyInformationLocked(conn, answered_packet=packet)
def test_23_unlockInformation2(self): def test_23_notifyUnlockInformation2(self):
# delete transaction informations # delete transaction informations
conn = Mock({ 'isServer': False, }) conn = Mock({ 'isServer': False, })
self.app.dm = Mock({ }) self.app.dm = Mock({ })
...@@ -174,7 +174,7 @@ class StorageMasterHandlerTests(NeoTestBase): ...@@ -174,7 +174,7 @@ class StorageMasterHandlerTests(NeoTestBase):
self.app.transaction_dict[INVALID_TID] = transaction self.app.transaction_dict[INVALID_TID] = transaction
self.app.load_lock_dict[0] = transaction self.app.load_lock_dict[0] = transaction
self.app.store_lock_dict[0] = transaction self.app.store_lock_dict[0] = transaction
self.operation.unlockInformation(conn, packet, INVALID_TID) self.operation.notifyUnlockInformation(conn, packet, INVALID_TID)
self.assertEquals(len(self.app.load_lock_dict), 0) self.assertEquals(len(self.app.load_lock_dict), 0)
self.assertEquals(len(self.app.store_lock_dict), 0) self.assertEquals(len(self.app.store_lock_dict), 0)
self.assertEquals(len(self.app.store_lock_dict), 0) self.assertEquals(len(self.app.store_lock_dict), 0)
......
...@@ -316,9 +316,9 @@ class ProtocolTests(NeoTestBase): ...@@ -316,9 +316,9 @@ class ProtocolTests(NeoTestBase):
self.assertEqual(ptid, tid) self.assertEqual(ptid, tid)
self.assertEqual(p_oid_list, oid_list) self.assertEqual(p_oid_list, oid_list)
def test_41_unlockInformation(self): def test_41_notifyUnlockInformation(self):
tid = self.getNextTID() tid = self.getNextTID()
p = Packets.UnlockInformation(tid) p = Packets.NotifyUnlockInformation(tid)
ptid = p.decode()[0] ptid = p.decode()[0]
self.assertEqual(ptid, tid) self.assertEqual(ptid, tid)
......
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