Commit ea3539cd authored by Vincent Pelletier's avatar Vincent Pelletier

Factorise neoctl handler code.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1133 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent d76037c9
......@@ -50,20 +50,8 @@ class CommandEventHandler(EventHandler):
super(CommandEventHandler, self).peerBroken(conn)
self.__disconnected()
def handleAnswerPartitionList(self, conn, packet, ptid, row_list):
self.__respond((packet.getType(), ptid, row_list))
def handleAnswerNodeList(self, conn, packet, node_list):
self.__respond((packet.getType(), node_list))
def handleAnswerNodeState(self, conn, packet, uuid, state):
self.__respond((packet.getType(), uuid, state))
def handleAnswerClusterState(self, conn, packet, state):
self.__respond((packet.getType(), state))
def handleAnswerNewNodes(self, conn, packet, uuid_list):
self.__respond((packet.getType(), uuid_list))
def __handleAnswer(self, conn, packet, *args):
self.__respond((packet.getType(), ) + args)
def handleNoError(self, conn, packet, msg):
self.__respond((packet.getType(), protocol.NO_ERROR_CODE, msg))
......@@ -71,3 +59,8 @@ class CommandEventHandler(EventHandler):
def handleNotReady(self, conn, packet, msg):
self.__respond((packet.getType(), protocol.NOT_READY_CODE, msg))
handleAnswerPartitionList = __handleAnswer
handleAnswerNodeList = __handleAnswer
handleAnswerNodeState = __handleAnswer
handleAnswerClusterState = __handleAnswer
handleAnswerNewNodes = __handleAnswer
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