From 2c0d04c7800f4ab321748e0a3c267e13e6faca02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Wisniewski?= <gregory@nexedi.com> Date: Fri, 22 May 2009 08:26:57 +0000 Subject: [PATCH] Fix misspelled BrokenNodeDisallowedError name. git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@512 71dcc9de-d417-0410-9af5-da40c76e7ee4 --- neo/handler.py | 4 ++-- neo/master/election.py | 2 +- neo/master/recovery.py | 2 +- neo/master/service.py | 2 +- neo/master/tests/testMasterElectionHandler.py | 8 ++++---- neo/master/tests/testMasterRecoveryHandler.py | 8 ++++---- neo/master/tests/testMasterService.py | 8 ++++---- neo/master/tests/testMasterVerificationHandler.py | 8 ++++---- neo/master/verification.py | 2 +- neo/protocol.py | 2 +- neo/storage/bootstrap.py | 2 +- neo/storage/operation.py | 2 +- neo/storage/tests/testStorageBootstrapHandler.py | 8 ++++---- neo/storage/tests/testStorageOperation.py | 8 ++++---- neo/storage/tests/testStorageVerificationHandler.py | 8 ++++---- neo/storage/verification.py | 2 +- 16 files changed, 38 insertions(+), 38 deletions(-) diff --git a/neo/handler.py b/neo/handler.py index e2f20171..597f1b75 100644 --- a/neo/handler.py +++ b/neo/handler.py @@ -19,7 +19,7 @@ import logging from neo import protocol from neo.protocol import Packet, PacketMalformedError, UnexpectedPacketError, \ - BrokenNotDisallowedError, NotReadyError, ProtocolError + BrokenNodeDisallowedError, NotReadyError, ProtocolError from neo.connection import ServerConnection from protocol import ERROR, REQUEST_NODE_IDENTIFICATION, ACCEPT_NODE_IDENTIFICATION, \ @@ -190,7 +190,7 @@ class EventHandler(object): self.unexpectedPacket(conn, packet, msg) except PacketMalformedError, msg: self.packetMalformed(conn, packet, msg) - except BrokenNotDisallowedError, msg: + except BrokenNodeDisallowedError, msg: self.brokenNodeDisallowedError(conn, packet, msg) except NotReadyError, msg: self.notReadyError(conn, packet, msg) diff --git a/neo/master/election.py b/neo/master/election.py index dc4c9ff2..c6070383 100644 --- a/neo/master/election.py +++ b/neo/master/election.py @@ -190,7 +190,7 @@ class ElectionEventHandler(MasterEventHandler): # If this node is broken, reject it. if node.getUUID() == uuid: if node.getState() == BROKEN_STATE: - raise protocol.BrokenNotDisallowedError + raise protocol.BrokenNodeDisallowedError # supplied another uuid in case of conflict while not app.isValidUUID(uuid, addr): diff --git a/neo/master/recovery.py b/neo/master/recovery.py index a11ea68b..8c1383ba 100644 --- a/neo/master/recovery.py +++ b/neo/master/recovery.py @@ -149,7 +149,7 @@ class RecoveryEventHandler(MasterEventHandler): # If this node is broken, reject it. Otherwise, assume that it is # working again. if node.getState() == BROKEN_STATE: - raise protocol.BrokenNotDisallowedError + raise protocol.BrokenNodeDisallowedError node.setUUID(uuid) node.setState(RUNNING_STATE) app.broadcastNodeInformation(node) diff --git a/neo/master/service.py b/neo/master/service.py index d2a7994c..78f4f859 100644 --- a/neo/master/service.py +++ b/neo/master/service.py @@ -253,7 +253,7 @@ class ServiceEventHandler(MasterEventHandler): # If this node is broken, reject it. Otherwise, assume that # it is working again. if node.getState() == BROKEN_STATE: - raise protocol.BrokenNotDisallowedError + raise protocol.BrokenNodeDisallowedError node.setUUID(uuid) node.setState(RUNNING_STATE) logging.debug('broadcasting node information') diff --git a/neo/master/tests/testMasterElectionHandler.py b/neo/master/tests/testMasterElectionHandler.py index 20807c7d..de733fc9 100644 --- a/neo/master/tests/testMasterElectionHandler.py +++ b/neo/master/tests/testMasterElectionHandler.py @@ -146,9 +146,9 @@ server: 127.0.0.1:10023 """ Check is the identification_required decorator is applied """ self.checkUnexpectedPacketRaised(method, *args, **kwargs) - def checkBrokenNotDisallowedErrorRaised(self, method, *args, **kwargs): - """ Check if the BrokenNotDisallowedError exception wxas raised """ - self.assertRaises(protocol.BrokenNotDisallowedError, method, *args, **kwargs) + def checkBrokenNodeDisallowedErrorRaised(self, method, *args, **kwargs): + """ Check if the BrokenNodeDisallowedError exception wxas raised """ + self.assertRaises(protocol.BrokenNodeDisallowedError, method, *args, **kwargs) def checkNotReadyErrorRaised(self, method, *args, **kwargs): """ Check if the NotReadyError exception wxas raised """ @@ -591,7 +591,7 @@ server: 127.0.0.1:10023 self.assertEqual(node.getState(), RUNNING_STATE) node.setState(BROKEN_STATE) self.assertEqual(node.getState(), BROKEN_STATE) - self.checkBrokenNotDisallowedErrorRaised( + self.checkBrokenNodeDisallowedErrorRaised( election.handleRequestNodeIdentification, conn, packet=packet, diff --git a/neo/master/tests/testMasterRecoveryHandler.py b/neo/master/tests/testMasterRecoveryHandler.py index b9d4f9e5..882cc373 100644 --- a/neo/master/tests/testMasterRecoveryHandler.py +++ b/neo/master/tests/testMasterRecoveryHandler.py @@ -156,9 +156,9 @@ server: 127.0.0.1:10023 """ Check is the identification_required decorator is applied """ self.checkUnexpectedPacketRaised(method, *args, **kwargs) - def checkBrokenNotDisallowedErrorRaised(self, method, *args, **kwargs): - """ Check if the BrokenNotDisallowedError exception wxas raised """ - self.assertRaises(protocol.BrokenNotDisallowedError, method, *args, **kwargs) + def checkBrokenNodeDisallowedErrorRaised(self, method, *args, **kwargs): + """ Check if the BrokenNodeDisallowedError exception wxas raised """ + self.assertRaises(protocol.BrokenNodeDisallowedError, method, *args, **kwargs) def checkNotReadyErrorRaised(self, method, *args, **kwargs): """ Check if the NotReadyError exception wxas raised """ @@ -460,7 +460,7 @@ server: 127.0.0.1:10023 self.assertEqual(node.getState(), BROKEN_STATE) self.assertEqual(node.getUUID(), uuid) self.assertEqual(len(self.app.nm.getMasterNodeList()), 2) - self.checkBrokenNotDisallowedErrorRaised( + self.checkBrokenNodeDisallowedErrorRaised( recovery.handleRequestNodeIdentification, conn, packet=packet, diff --git a/neo/master/tests/testMasterService.py b/neo/master/tests/testMasterService.py index 7f7cd340..10d88c10 100644 --- a/neo/master/tests/testMasterService.py +++ b/neo/master/tests/testMasterService.py @@ -128,9 +128,9 @@ server: 127.0.0.1:10023 """ Check is the identification_required decorator is applied """ self.checkUnexpectedPacketRaised(method, *args, **kwargs) - def checkBrokenNotDisallowedErrorRaised(self, method, *args, **kwargs): - """ Check if the BrokenNotDisallowedError exception wxas raised """ - self.assertRaises(protocol.BrokenNotDisallowedError, method, *args, **kwargs) + def checkBrokenNodeDisallowedErrorRaised(self, method, *args, **kwargs): + """ Check if the BrokenNodeDisallowedError exception wxas raised """ + self.assertRaises(protocol.BrokenNodeDisallowedError, method, *args, **kwargs) # Method to test the kind of packet returned in answer def checkCalledAbort(self, conn, packet_number=0): @@ -377,7 +377,7 @@ server: 127.0.0.1:10023 sn.setState(BROKEN_STATE) self.assertEquals(sn.getState(), BROKEN_STATE) - self.checkBrokenNotDisallowedErrorRaised( + self.checkBrokenNodeDisallowedErrorRaised( service.handleRequestNodeIdentification, conn, packet=packet, diff --git a/neo/master/tests/testMasterVerificationHandler.py b/neo/master/tests/testMasterVerificationHandler.py index 0750cc61..e6dc5ffb 100644 --- a/neo/master/tests/testMasterVerificationHandler.py +++ b/neo/master/tests/testMasterVerificationHandler.py @@ -135,9 +135,9 @@ server: 127.0.0.1:10023 """ Check is the identification_required decorator is applied """ self.checkUnexpectedPacketRaised(method, *args, **kwargs) - def checkBrokenNotDisallowedErrorRaised(self, method, *args, **kwargs): - """ Check if the BrokenNotDisallowedError exception wxas raised """ - self.assertRaises(protocol.BrokenNotDisallowedError, method, *args, **kwargs) + def checkBrokenNodeDisallowedErrorRaised(self, method, *args, **kwargs): + """ Check if the BrokenNodeDisallowedError exception wxas raised """ + self.assertRaises(protocol.BrokenNodeDisallowedError, method, *args, **kwargs) def checkNotReadyErrorRaised(self, method, *args, **kwargs): """ Check if the NotReadyError exception wxas raised """ @@ -482,7 +482,7 @@ server: 127.0.0.1:10023 self.assertEqual(node.getState(), BROKEN_STATE) self.assertEqual(node.getUUID(), uuid) self.assertEqual(len(self.app.nm.getMasterNodeList()), 2) - self.checkBrokenNotDisallowedErrorRaised( + self.checkBrokenNodeDisallowedErrorRaised( verification.handleRequestNodeIdentification, conn, packet=packet, diff --git a/neo/master/verification.py b/neo/master/verification.py index a57cdeee..d80ad918 100644 --- a/neo/master/verification.py +++ b/neo/master/verification.py @@ -173,7 +173,7 @@ class VerificationEventHandler(MasterEventHandler): # If this node is broken, reject it. Otherwise, assume that it is # working again. if node.getState() == BROKEN_STATE: - raise protocol.BrokenNotDisallowedError + raise protocol.BrokenNodeDisallowedError node.setUUID(uuid) node.setState(RUNNING_STATE) app.broadcastNodeInformation(node) diff --git a/neo/protocol.py b/neo/protocol.py index 22894b3d..7618c39b 100644 --- a/neo/protocol.py +++ b/neo/protocol.py @@ -334,7 +334,7 @@ class NotReadyError(ProtocolError): """ Just close the connection """ pass -class BrokenNotDisallowedError(ProtocolError): +class BrokenNodeDisallowedError(ProtocolError): """ Just close the connection """ pass diff --git a/neo/storage/bootstrap.py b/neo/storage/bootstrap.py index 9dec1027..583ae17c 100644 --- a/neo/storage/bootstrap.py +++ b/neo/storage/bootstrap.py @@ -129,7 +129,7 @@ class BootstrapEventHandler(StorageEventHandler): # If this node is broken, reject it. if node.getUUID() == uuid: if node.getState() == BROKEN_STATE: - raise protocol.BrokenNotDisallowedError + raise protocol.BrokenNodeDisallowedError # Trust the UUID sent by the peer. node.setUUID(uuid) diff --git a/neo/storage/operation.py b/neo/storage/operation.py index 86cc8c8b..bc5f03af 100644 --- a/neo/storage/operation.py +++ b/neo/storage/operation.py @@ -157,7 +157,7 @@ class OperationEventHandler(StorageEventHandler): # If this node is broken, reject it. if node.getUUID() == uuid: if node.getState() == BROKEN_STATE: - raise protocol.BrokenNotDisallowedError + raise protocol.BrokenNodeDisallowedError # Trust the UUID sent by the peer. node.setUUID(uuid) diff --git a/neo/storage/tests/testStorageBootstrapHandler.py b/neo/storage/tests/testStorageBootstrapHandler.py index 438d8bc7..9ce0b1c8 100644 --- a/neo/storage/tests/testStorageBootstrapHandler.py +++ b/neo/storage/tests/testStorageBootstrapHandler.py @@ -118,9 +118,9 @@ server: 127.0.0.1:10020 """ Check is the identification_required decorator is applied """ self.checkUnexpectedPacketRaised(method, *args, **kwargs) - def checkBrokenNotDisallowedErrorRaised(self, method, *args, **kwargs): - """ Check if the BrokenNotDisallowedError exception wxas raised """ - self.assertRaises(protocol.BrokenNotDisallowedError, method, *args, **kwargs) + def checkBrokenNodeDisallowedErrorRaised(self, method, *args, **kwargs): + """ Check if the BrokenNodeDisallowedError exception wxas raised """ + self.assertRaises(protocol.BrokenNodeDisallowedError, method, *args, **kwargs) def checkNotReadyErrorRaised(self, method, *args, **kwargs): """ Check if the NotReadyError exception wxas raised """ @@ -375,7 +375,7 @@ server: 127.0.0.1:10020 uuid=self.getNewUUID() master.setState(BROKEN_STATE) master.setUUID(uuid) - self.checkBrokenNotDisallowedErrorRaised( + self.checkBrokenNodeDisallowedErrorRaised( self.bootstrap.handleRequestNodeIdentification, conn=conn, uuid=uuid, diff --git a/neo/storage/tests/testStorageOperation.py b/neo/storage/tests/testStorageOperation.py index 796c9785..3a61ac94 100644 --- a/neo/storage/tests/testStorageOperation.py +++ b/neo/storage/tests/testStorageOperation.py @@ -63,9 +63,9 @@ class StorageOperationTests(unittest.TestCase): """ Check is the identification_required decorator is applied """ self.checkUnexpectedPacketRaised(method, *args, **kwargs) - def checkBrokenNotDisallowedErrorRaised(self, method, *args, **kwargs): - """ Check if the BrokenNotDisallowedError exception wxas raised """ - self.assertRaises(protocol.BrokenNotDisallowedError, method, *args, **kwargs) + def checkBrokenNodeDisallowedErrorRaised(self, method, *args, **kwargs): + """ Check if the BrokenNodeDisallowedError exception wxas raised """ + self.assertRaises(protocol.BrokenNodeDisallowedError, method, *args, **kwargs) def checkNotReadyErrorRaised(self, method, *args, **kwargs): """ Check if the NotReadyError exception wxas raised """ @@ -386,7 +386,7 @@ server: 127.0.0.1:10020 "getAddress" : ("127.0.0.1", self.master_port), }) count = len(self.app.nm.getNodeList()) - self.checkBrokenNotDisallowedErrorRaised( + self.checkBrokenNodeDisallowedErrorRaised( self.operation.handleRequestNodeIdentification, conn=conn, packet=packet, diff --git a/neo/storage/tests/testStorageVerificationHandler.py b/neo/storage/tests/testStorageVerificationHandler.py index 47840456..848567f9 100644 --- a/neo/storage/tests/testStorageVerificationHandler.py +++ b/neo/storage/tests/testStorageVerificationHandler.py @@ -139,9 +139,9 @@ server: 127.0.0.1:10020 """ Check is the identification_required decorator is applied """ self.checkUnexpectedPacketRaised(method, *args, **kwargs) - def checkBrokenNotDisallowedErrorRaised(self, method, *args, **kwargs): - """ Check if the BrokenNotDisallowedError exception wxas raised """ - self.assertRaises(protocol.BrokenNotDisallowedError, method, *args, **kwargs) + def checkBrokenNodeDisallowedErrorRaised(self, method, *args, **kwargs): + """ Check if the BrokenNodeDisallowedError exception wxas raised """ + self.assertRaises(protocol.BrokenNodeDisallowedError, method, *args, **kwargs) def checkNotReadyErrorRaised(self, method, *args, **kwargs): """ Check if the NotReadyError exception wxas raised """ @@ -291,7 +291,7 @@ server: 127.0.0.1:10020 node = self.app.nm.getNodeByServer(conn.getAddress()) node.setState(BROKEN_STATE) self.assertEqual(node.getUUID(), uuid) - self.checkBrokenNotDisallowedErrorRaised( + self.checkBrokenNodeDisallowedErrorRaised( self.verification.handleRequestNodeIdentification, conn, p, MASTER_NODE_TYPE, uuid, "127.0.0.1", self.master_port, "main") diff --git a/neo/storage/verification.py b/neo/storage/verification.py index 04245442..d9b0f2e3 100644 --- a/neo/storage/verification.py +++ b/neo/storage/verification.py @@ -83,7 +83,7 @@ class VerificationEventHandler(StorageEventHandler): # If this node is broken, reject it. if node.getUUID() == uuid: if node.getState() == BROKEN_STATE: - raise protocol.BrokenNotDisallowedError + raise protocol.BrokenNodeDisallowedError # Trust the UUID sent by the peer. node.setUUID(uuid) -- 2.30.9