Commit fee708c3 authored by Vincent Pelletier's avatar Vincent Pelletier

Simplify identifyStorageNode parameters.

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