Commit 7de9f20c authored by Vincent Pelletier's avatar Vincent Pelletier

Factorise master ShutdownHandler.

parent ab3a7d29
...@@ -19,20 +19,12 @@ import neo.lib ...@@ -19,20 +19,12 @@ import neo.lib
from neo.lib import protocol from neo.lib import protocol
from . import BaseServiceHandler from . import BaseServiceHandler
def reject(*args, **kw):
raise protocol.ProtocolError('cluster is shutting down')
class ShutdownHandler(BaseServiceHandler): class ShutdownHandler(BaseServiceHandler):
"""This class deals with events for a shutting down phase.""" """This class deals with events for a shutting down phase."""
def requestIdentification(self, conn, node_type, requestIdentification = reject
uuid, address, name): askPrimary = reject
neo.lib.logging.error('reject any new connection') askBeginTransaction = reject
raise protocol.ProtocolError('cluster is shutting down')
def askPrimary(self, conn):
neo.lib.logging.error('reject any new demand for primary master')
raise protocol.ProtocolError('cluster is shutting down')
def askBeginTransaction(self, conn, tid):
neo.lib.logging.error('reject any new demand for new tid')
raise protocol.ProtocolError('cluster is shutting down')
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