Commit 2c0d04c7 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Fix misspelled BrokenNodeDisallowedError name.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@512 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 8c64c99e
...@@ -19,7 +19,7 @@ import logging ...@@ -19,7 +19,7 @@ import logging
from neo import protocol from neo import protocol
from neo.protocol import Packet, PacketMalformedError, UnexpectedPacketError, \ from neo.protocol import Packet, PacketMalformedError, UnexpectedPacketError, \
BrokenNotDisallowedError, NotReadyError, ProtocolError BrokenNodeDisallowedError, NotReadyError, ProtocolError
from neo.connection import ServerConnection from neo.connection import ServerConnection
from protocol import ERROR, REQUEST_NODE_IDENTIFICATION, ACCEPT_NODE_IDENTIFICATION, \ from protocol import ERROR, REQUEST_NODE_IDENTIFICATION, ACCEPT_NODE_IDENTIFICATION, \
...@@ -190,7 +190,7 @@ class EventHandler(object): ...@@ -190,7 +190,7 @@ class EventHandler(object):
self.unexpectedPacket(conn, packet, msg) self.unexpectedPacket(conn, packet, msg)
except PacketMalformedError, msg: except PacketMalformedError, msg:
self.packetMalformed(conn, packet, msg) self.packetMalformed(conn, packet, msg)
except BrokenNotDisallowedError, msg: except BrokenNodeDisallowedError, msg:
self.brokenNodeDisallowedError(conn, packet, msg) self.brokenNodeDisallowedError(conn, packet, msg)
except NotReadyError, msg: except NotReadyError, msg:
self.notReadyError(conn, packet, msg) self.notReadyError(conn, packet, msg)
......
...@@ -190,7 +190,7 @@ class ElectionEventHandler(MasterEventHandler): ...@@ -190,7 +190,7 @@ class ElectionEventHandler(MasterEventHandler):
# If this node is broken, reject it. # If this node is broken, reject it.
if node.getUUID() == uuid: if node.getUUID() == uuid:
if node.getState() == BROKEN_STATE: if node.getState() == BROKEN_STATE:
raise protocol.BrokenNotDisallowedError raise protocol.BrokenNodeDisallowedError
# supplied another uuid in case of conflict # supplied another uuid in case of conflict
while not app.isValidUUID(uuid, addr): while not app.isValidUUID(uuid, addr):
......
...@@ -149,7 +149,7 @@ class RecoveryEventHandler(MasterEventHandler): ...@@ -149,7 +149,7 @@ class RecoveryEventHandler(MasterEventHandler):
# If this node is broken, reject it. Otherwise, assume that it is # If this node is broken, reject it. Otherwise, assume that it is
# working again. # working again.
if node.getState() == BROKEN_STATE: if node.getState() == BROKEN_STATE:
raise protocol.BrokenNotDisallowedError raise protocol.BrokenNodeDisallowedError
node.setUUID(uuid) node.setUUID(uuid)
node.setState(RUNNING_STATE) node.setState(RUNNING_STATE)
app.broadcastNodeInformation(node) app.broadcastNodeInformation(node)
......
...@@ -253,7 +253,7 @@ class ServiceEventHandler(MasterEventHandler): ...@@ -253,7 +253,7 @@ class ServiceEventHandler(MasterEventHandler):
# If this node is broken, reject it. Otherwise, assume that # If this node is broken, reject it. Otherwise, assume that
# it is working again. # it is working again.
if node.getState() == BROKEN_STATE: if node.getState() == BROKEN_STATE:
raise protocol.BrokenNotDisallowedError raise protocol.BrokenNodeDisallowedError
node.setUUID(uuid) node.setUUID(uuid)
node.setState(RUNNING_STATE) node.setState(RUNNING_STATE)
logging.debug('broadcasting node information') logging.debug('broadcasting node information')
......
...@@ -146,9 +146,9 @@ server: 127.0.0.1:10023 ...@@ -146,9 +146,9 @@ server: 127.0.0.1:10023
""" Check is the identification_required decorator is applied """ """ Check is the identification_required decorator is applied """
self.checkUnexpectedPacketRaised(method, *args, **kwargs) self.checkUnexpectedPacketRaised(method, *args, **kwargs)
def checkBrokenNotDisallowedErrorRaised(self, method, *args, **kwargs): def checkBrokenNodeDisallowedErrorRaised(self, method, *args, **kwargs):
""" Check if the BrokenNotDisallowedError exception wxas raised """ """ Check if the BrokenNodeDisallowedError exception wxas raised """
self.assertRaises(protocol.BrokenNotDisallowedError, method, *args, **kwargs) self.assertRaises(protocol.BrokenNodeDisallowedError, method, *args, **kwargs)
def checkNotReadyErrorRaised(self, method, *args, **kwargs): def checkNotReadyErrorRaised(self, method, *args, **kwargs):
""" Check if the NotReadyError exception wxas raised """ """ Check if the NotReadyError exception wxas raised """
...@@ -591,7 +591,7 @@ server: 127.0.0.1:10023 ...@@ -591,7 +591,7 @@ server: 127.0.0.1:10023
self.assertEqual(node.getState(), RUNNING_STATE) self.assertEqual(node.getState(), RUNNING_STATE)
node.setState(BROKEN_STATE) node.setState(BROKEN_STATE)
self.assertEqual(node.getState(), BROKEN_STATE) self.assertEqual(node.getState(), BROKEN_STATE)
self.checkBrokenNotDisallowedErrorRaised( self.checkBrokenNodeDisallowedErrorRaised(
election.handleRequestNodeIdentification, election.handleRequestNodeIdentification,
conn, conn,
packet=packet, packet=packet,
......
...@@ -156,9 +156,9 @@ server: 127.0.0.1:10023 ...@@ -156,9 +156,9 @@ server: 127.0.0.1:10023
""" Check is the identification_required decorator is applied """ """ Check is the identification_required decorator is applied """
self.checkUnexpectedPacketRaised(method, *args, **kwargs) self.checkUnexpectedPacketRaised(method, *args, **kwargs)
def checkBrokenNotDisallowedErrorRaised(self, method, *args, **kwargs): def checkBrokenNodeDisallowedErrorRaised(self, method, *args, **kwargs):
""" Check if the BrokenNotDisallowedError exception wxas raised """ """ Check if the BrokenNodeDisallowedError exception wxas raised """
self.assertRaises(protocol.BrokenNotDisallowedError, method, *args, **kwargs) self.assertRaises(protocol.BrokenNodeDisallowedError, method, *args, **kwargs)
def checkNotReadyErrorRaised(self, method, *args, **kwargs): def checkNotReadyErrorRaised(self, method, *args, **kwargs):
""" Check if the NotReadyError exception wxas raised """ """ Check if the NotReadyError exception wxas raised """
...@@ -460,7 +460,7 @@ server: 127.0.0.1:10023 ...@@ -460,7 +460,7 @@ server: 127.0.0.1:10023
self.assertEqual(node.getState(), BROKEN_STATE) self.assertEqual(node.getState(), BROKEN_STATE)
self.assertEqual(node.getUUID(), uuid) self.assertEqual(node.getUUID(), uuid)
self.assertEqual(len(self.app.nm.getMasterNodeList()), 2) self.assertEqual(len(self.app.nm.getMasterNodeList()), 2)
self.checkBrokenNotDisallowedErrorRaised( self.checkBrokenNodeDisallowedErrorRaised(
recovery.handleRequestNodeIdentification, recovery.handleRequestNodeIdentification,
conn, conn,
packet=packet, packet=packet,
......
...@@ -128,9 +128,9 @@ server: 127.0.0.1:10023 ...@@ -128,9 +128,9 @@ server: 127.0.0.1:10023
""" Check is the identification_required decorator is applied """ """ Check is the identification_required decorator is applied """
self.checkUnexpectedPacketRaised(method, *args, **kwargs) self.checkUnexpectedPacketRaised(method, *args, **kwargs)
def checkBrokenNotDisallowedErrorRaised(self, method, *args, **kwargs): def checkBrokenNodeDisallowedErrorRaised(self, method, *args, **kwargs):
""" Check if the BrokenNotDisallowedError exception wxas raised """ """ Check if the BrokenNodeDisallowedError exception wxas raised """
self.assertRaises(protocol.BrokenNotDisallowedError, method, *args, **kwargs) self.assertRaises(protocol.BrokenNodeDisallowedError, method, *args, **kwargs)
# Method to test the kind of packet returned in answer # Method to test the kind of packet returned in answer
def checkCalledAbort(self, conn, packet_number=0): def checkCalledAbort(self, conn, packet_number=0):
...@@ -377,7 +377,7 @@ server: 127.0.0.1:10023 ...@@ -377,7 +377,7 @@ server: 127.0.0.1:10023
sn.setState(BROKEN_STATE) sn.setState(BROKEN_STATE)
self.assertEquals(sn.getState(), BROKEN_STATE) self.assertEquals(sn.getState(), BROKEN_STATE)
self.checkBrokenNotDisallowedErrorRaised( self.checkBrokenNodeDisallowedErrorRaised(
service.handleRequestNodeIdentification, service.handleRequestNodeIdentification,
conn, conn,
packet=packet, packet=packet,
......
...@@ -135,9 +135,9 @@ server: 127.0.0.1:10023 ...@@ -135,9 +135,9 @@ server: 127.0.0.1:10023
""" Check is the identification_required decorator is applied """ """ Check is the identification_required decorator is applied """
self.checkUnexpectedPacketRaised(method, *args, **kwargs) self.checkUnexpectedPacketRaised(method, *args, **kwargs)
def checkBrokenNotDisallowedErrorRaised(self, method, *args, **kwargs): def checkBrokenNodeDisallowedErrorRaised(self, method, *args, **kwargs):
""" Check if the BrokenNotDisallowedError exception wxas raised """ """ Check if the BrokenNodeDisallowedError exception wxas raised """
self.assertRaises(protocol.BrokenNotDisallowedError, method, *args, **kwargs) self.assertRaises(protocol.BrokenNodeDisallowedError, method, *args, **kwargs)
def checkNotReadyErrorRaised(self, method, *args, **kwargs): def checkNotReadyErrorRaised(self, method, *args, **kwargs):
""" Check if the NotReadyError exception wxas raised """ """ Check if the NotReadyError exception wxas raised """
...@@ -482,7 +482,7 @@ server: 127.0.0.1:10023 ...@@ -482,7 +482,7 @@ server: 127.0.0.1:10023
self.assertEqual(node.getState(), BROKEN_STATE) self.assertEqual(node.getState(), BROKEN_STATE)
self.assertEqual(node.getUUID(), uuid) self.assertEqual(node.getUUID(), uuid)
self.assertEqual(len(self.app.nm.getMasterNodeList()), 2) self.assertEqual(len(self.app.nm.getMasterNodeList()), 2)
self.checkBrokenNotDisallowedErrorRaised( self.checkBrokenNodeDisallowedErrorRaised(
verification.handleRequestNodeIdentification, verification.handleRequestNodeIdentification,
conn, conn,
packet=packet, packet=packet,
......
...@@ -173,7 +173,7 @@ class VerificationEventHandler(MasterEventHandler): ...@@ -173,7 +173,7 @@ class VerificationEventHandler(MasterEventHandler):
# If this node is broken, reject it. Otherwise, assume that it is # If this node is broken, reject it. Otherwise, assume that it is
# working again. # working again.
if node.getState() == BROKEN_STATE: if node.getState() == BROKEN_STATE:
raise protocol.BrokenNotDisallowedError raise protocol.BrokenNodeDisallowedError
node.setUUID(uuid) node.setUUID(uuid)
node.setState(RUNNING_STATE) node.setState(RUNNING_STATE)
app.broadcastNodeInformation(node) app.broadcastNodeInformation(node)
......
...@@ -334,7 +334,7 @@ class NotReadyError(ProtocolError): ...@@ -334,7 +334,7 @@ class NotReadyError(ProtocolError):
""" Just close the connection """ """ Just close the connection """
pass pass
class BrokenNotDisallowedError(ProtocolError): class BrokenNodeDisallowedError(ProtocolError):
""" Just close the connection """ """ Just close the connection """
pass pass
......
...@@ -129,7 +129,7 @@ class BootstrapEventHandler(StorageEventHandler): ...@@ -129,7 +129,7 @@ class BootstrapEventHandler(StorageEventHandler):
# If this node is broken, reject it. # If this node is broken, reject it.
if node.getUUID() == uuid: if node.getUUID() == uuid:
if node.getState() == BROKEN_STATE: if node.getState() == BROKEN_STATE:
raise protocol.BrokenNotDisallowedError raise protocol.BrokenNodeDisallowedError
# Trust the UUID sent by the peer. # Trust the UUID sent by the peer.
node.setUUID(uuid) node.setUUID(uuid)
......
...@@ -157,7 +157,7 @@ class OperationEventHandler(StorageEventHandler): ...@@ -157,7 +157,7 @@ class OperationEventHandler(StorageEventHandler):
# If this node is broken, reject it. # If this node is broken, reject it.
if node.getUUID() == uuid: if node.getUUID() == uuid:
if node.getState() == BROKEN_STATE: if node.getState() == BROKEN_STATE:
raise protocol.BrokenNotDisallowedError raise protocol.BrokenNodeDisallowedError
# Trust the UUID sent by the peer. # Trust the UUID sent by the peer.
node.setUUID(uuid) node.setUUID(uuid)
......
...@@ -118,9 +118,9 @@ server: 127.0.0.1:10020 ...@@ -118,9 +118,9 @@ server: 127.0.0.1:10020
""" Check is the identification_required decorator is applied """ """ Check is the identification_required decorator is applied """
self.checkUnexpectedPacketRaised(method, *args, **kwargs) self.checkUnexpectedPacketRaised(method, *args, **kwargs)
def checkBrokenNotDisallowedErrorRaised(self, method, *args, **kwargs): def checkBrokenNodeDisallowedErrorRaised(self, method, *args, **kwargs):
""" Check if the BrokenNotDisallowedError exception wxas raised """ """ Check if the BrokenNodeDisallowedError exception wxas raised """
self.assertRaises(protocol.BrokenNotDisallowedError, method, *args, **kwargs) self.assertRaises(protocol.BrokenNodeDisallowedError, method, *args, **kwargs)
def checkNotReadyErrorRaised(self, method, *args, **kwargs): def checkNotReadyErrorRaised(self, method, *args, **kwargs):
""" Check if the NotReadyError exception wxas raised """ """ Check if the NotReadyError exception wxas raised """
...@@ -375,7 +375,7 @@ server: 127.0.0.1:10020 ...@@ -375,7 +375,7 @@ server: 127.0.0.1:10020
uuid=self.getNewUUID() uuid=self.getNewUUID()
master.setState(BROKEN_STATE) master.setState(BROKEN_STATE)
master.setUUID(uuid) master.setUUID(uuid)
self.checkBrokenNotDisallowedErrorRaised( self.checkBrokenNodeDisallowedErrorRaised(
self.bootstrap.handleRequestNodeIdentification, self.bootstrap.handleRequestNodeIdentification,
conn=conn, conn=conn,
uuid=uuid, uuid=uuid,
......
...@@ -63,9 +63,9 @@ class StorageOperationTests(unittest.TestCase): ...@@ -63,9 +63,9 @@ class StorageOperationTests(unittest.TestCase):
""" Check is the identification_required decorator is applied """ """ Check is the identification_required decorator is applied """
self.checkUnexpectedPacketRaised(method, *args, **kwargs) self.checkUnexpectedPacketRaised(method, *args, **kwargs)
def checkBrokenNotDisallowedErrorRaised(self, method, *args, **kwargs): def checkBrokenNodeDisallowedErrorRaised(self, method, *args, **kwargs):
""" Check if the BrokenNotDisallowedError exception wxas raised """ """ Check if the BrokenNodeDisallowedError exception wxas raised """
self.assertRaises(protocol.BrokenNotDisallowedError, method, *args, **kwargs) self.assertRaises(protocol.BrokenNodeDisallowedError, method, *args, **kwargs)
def checkNotReadyErrorRaised(self, method, *args, **kwargs): def checkNotReadyErrorRaised(self, method, *args, **kwargs):
""" Check if the NotReadyError exception wxas raised """ """ Check if the NotReadyError exception wxas raised """
...@@ -386,7 +386,7 @@ server: 127.0.0.1:10020 ...@@ -386,7 +386,7 @@ server: 127.0.0.1:10020
"getAddress" : ("127.0.0.1", self.master_port), "getAddress" : ("127.0.0.1", self.master_port),
}) })
count = len(self.app.nm.getNodeList()) count = len(self.app.nm.getNodeList())
self.checkBrokenNotDisallowedErrorRaised( self.checkBrokenNodeDisallowedErrorRaised(
self.operation.handleRequestNodeIdentification, self.operation.handleRequestNodeIdentification,
conn=conn, conn=conn,
packet=packet, packet=packet,
......
...@@ -139,9 +139,9 @@ server: 127.0.0.1:10020 ...@@ -139,9 +139,9 @@ server: 127.0.0.1:10020
""" Check is the identification_required decorator is applied """ """ Check is the identification_required decorator is applied """
self.checkUnexpectedPacketRaised(method, *args, **kwargs) self.checkUnexpectedPacketRaised(method, *args, **kwargs)
def checkBrokenNotDisallowedErrorRaised(self, method, *args, **kwargs): def checkBrokenNodeDisallowedErrorRaised(self, method, *args, **kwargs):
""" Check if the BrokenNotDisallowedError exception wxas raised """ """ Check if the BrokenNodeDisallowedError exception wxas raised """
self.assertRaises(protocol.BrokenNotDisallowedError, method, *args, **kwargs) self.assertRaises(protocol.BrokenNodeDisallowedError, method, *args, **kwargs)
def checkNotReadyErrorRaised(self, method, *args, **kwargs): def checkNotReadyErrorRaised(self, method, *args, **kwargs):
""" Check if the NotReadyError exception wxas raised """ """ Check if the NotReadyError exception wxas raised """
...@@ -291,7 +291,7 @@ server: 127.0.0.1:10020 ...@@ -291,7 +291,7 @@ server: 127.0.0.1:10020
node = self.app.nm.getNodeByServer(conn.getAddress()) node = self.app.nm.getNodeByServer(conn.getAddress())
node.setState(BROKEN_STATE) node.setState(BROKEN_STATE)
self.assertEqual(node.getUUID(), uuid) self.assertEqual(node.getUUID(), uuid)
self.checkBrokenNotDisallowedErrorRaised( self.checkBrokenNodeDisallowedErrorRaised(
self.verification.handleRequestNodeIdentification, self.verification.handleRequestNodeIdentification,
conn, p, MASTER_NODE_TYPE, conn, p, MASTER_NODE_TYPE,
uuid, "127.0.0.1", self.master_port, "main") uuid, "127.0.0.1", self.master_port, "main")
......
...@@ -83,7 +83,7 @@ class VerificationEventHandler(StorageEventHandler): ...@@ -83,7 +83,7 @@ class VerificationEventHandler(StorageEventHandler):
# If this node is broken, reject it. # If this node is broken, reject it.
if node.getUUID() == uuid: if node.getUUID() == uuid:
if node.getState() == BROKEN_STATE: if node.getState() == BROKEN_STATE:
raise protocol.BrokenNotDisallowedError raise protocol.BrokenNodeDisallowedError
# Trust the UUID sent by the peer. # Trust the UUID sent by the peer.
node.setUUID(uuid) node.setUUID(uuid)
......
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