Commit 4eae1f6b authored by Julien Muchembled's avatar Julien Muchembled

master: simplify import of 'NotReadyError' in app.py

parent 23e38173
...@@ -19,10 +19,9 @@ import neo ...@@ -19,10 +19,9 @@ import neo
import os, sys import os, sys
from time import time from time import time
from neo.lib import protocol
from neo.lib.connector import getConnectorHandler from neo.lib.connector import getConnectorHandler
from neo.lib.debug import register as registerLiveDebugger from neo.lib.debug import register as registerLiveDebugger
from neo.lib.protocol import UUID_NAMESPACES, ZERO_TID from neo.lib.protocol import UUID_NAMESPACES, ZERO_TID, NotReadyError
from neo.lib.protocol import ClusterStates, NodeStates, NodeTypes, Packets from neo.lib.protocol import ClusterStates, NodeStates, NodeTypes, Packets
from neo.lib.node import NodeManager from neo.lib.node import NodeManager
from neo.lib.event import EventManager from neo.lib.event import EventManager
...@@ -446,7 +445,7 @@ class Application(object): ...@@ -446,7 +445,7 @@ class Application(object):
state = NodeStates.PENDING state = NodeStates.PENDING
handler = storage.StorageServiceHandler(self) handler = storage.StorageServiceHandler(self)
elif self.cluster_state == ClusterStates.STOPPING: elif self.cluster_state == ClusterStates.STOPPING:
raise protocol.NotReadyError raise NotReadyError
else: else:
raise RuntimeError('unhandled cluster state: %s' % raise RuntimeError('unhandled cluster state: %s' %
(self.cluster_state, )) (self.cluster_state, ))
...@@ -470,7 +469,7 @@ class Application(object): ...@@ -470,7 +469,7 @@ class Application(object):
# refuse any client before running # refuse any client before running
if self.cluster_state != ClusterStates.RUNNING: if self.cluster_state != ClusterStates.RUNNING:
neo.lib.logging.info('Reject a connection from a client') neo.lib.logging.info('Reject a connection from a client')
raise protocol.NotReadyError raise NotReadyError
node_ctor = self.nm.createClient node_ctor = self.nm.createClient
handler = client.ClientServiceHandler(self) handler = client.ClientServiceHandler(self)
neo.lib.logging.info('Accept a client %s' % (dump(uuid), )) neo.lib.logging.info('Accept a client %s' % (dump(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