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

Use decorators in admin handler.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@523 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent ec6ddd6b
......@@ -28,6 +28,7 @@ from neo.protocol import Packet, UnexpectedPacketError
from neo.pt import PartitionTable
from neo.exception import PrimaryFailure
from neo.util import dump
from neo.handler import identification_required, restrict_node_types
class BaseEventHandler(EventHandler):
""" Base handler for admin node """
......@@ -215,13 +216,11 @@ class MonitoringEventHandler(BaseEventHandler):
app.trying_master_node = None
conn.close()
@identification_required
def handleSendPartitionTable(self, conn, packet, ptid, row_list):
logging.warning("handleSendPartitionTable")
uuid = conn.getUUID()
if uuid is None:
raise UnexpectedPacketError
app = self.app
nm = app.nm
pt = app.pt
......@@ -243,15 +242,13 @@ class MonitoringEventHandler(BaseEventHandler):
pt.setCell(offset, node, state)
@identification_required
def handleNotifyPartitionChanges(self, conn, packet, ptid, cell_list):
logging.warning("handleNotifyPartitionChanges")
app = self.app
nm = app.nm
pt = app.pt
uuid = conn.getUUID()
if uuid is None:
raise UnexpectedPacketError
node = app.nm.getNodeByUUID(uuid)
# This must be sent only by primary master node
if node.getNodeType() != MASTER_NODE_TYPE \
......@@ -275,12 +272,10 @@ class MonitoringEventHandler(BaseEventHandler):
pt.setCell(offset, node, state)
@identification_required
def handleNotifyNodeInformation(self, conn, packet, node_list):
logging.warning("handleNotifyNodeInformation")
uuid = conn.getUUID()
if uuid is None:
raise UnexpectedPacketError
app = self.app
nm = app.nm
node = nm.getNodeByUUID(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