Commit fee708c3 authored by Vincent Pelletier's avatar Vincent Pelletier

Simplify identifyStorageNode parameters.

parent b041a797
......@@ -467,11 +467,12 @@ class Application(object):
# then shutdown
sys.exit()
def identifyStorageNode(self, uuid, node):
def identifyStorageNode(self, known):
if self.cluster_state == ClusterStates.STOPPING:
raise NotReadyError
state = NodeStates.RUNNING
if uuid is None or node is None:
if known:
state = NodeStates.RUNNING
else:
# same as for verification
state = NodeStates.PENDING
return state, self.storage_service_handler
......
......@@ -53,7 +53,8 @@ class IdentificationHandler(MasterHandler):
manager = app._current_manager
if manager is None:
manager = app
state, handler = manager.identifyStorageNode(uuid, node)
state, handler = manager.identifyStorageNode(
uuid is not None and node is not None)
human_readable_node_type = ' storage (%s) ' % (state, )
elif node_type == NodeTypes.MASTER:
node_ctor = app.nm.createMaster
......
......@@ -37,7 +37,7 @@ class RecoveryManager(MasterHandler):
def getHandler(self):
return self
def identifyStorageNode(self, uuid, node):
def identifyStorageNode(self, _):
"""
Returns the handler for storage nodes
"""
......
......@@ -77,12 +77,13 @@ class VerificationManager(BaseServiceHandler):
def getHandler(self):
return self
def identifyStorageNode(self, uuid, node):
def identifyStorageNode(self, known):
"""
Returns the handler to manager the given node
"""
state = NodeStates.RUNNING
if uuid is None or node is None:
if known:
state = NodeStates.RUNNING
else:
# if node is unknown, it has been forget when the current
# partition was validated by the admin
# Here the uuid is not cleared to allow lookup pending nodes by
......
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