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

Add drop node command to remove a storage node and drop it from the partition

table (alias to 'set node <uuid> DOWN 1')


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@921 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent bc6d6810
......@@ -123,13 +123,25 @@ def printPTAction(options):
def startCluster(options):
"""
Allow it to leave the recovery stage and accept the current partition table,
or make an empty if nothing was found.
Allow it to leave the recovery stage and accept the current partition
table, or make an empty if nothing was found.
Parameter: Cluster name
"""
name = options.pop(0)
return protocol.setClusterState(name, protocol.VERIFYING)
def dropNode(options):
"""
Drop one or more storage node from the partition table. Its content
is definitely lost. Be carefull because currently there is no check
about the cluster operational status, so you can drop a node with
non-replicated data.
Parameter: UUID
"""
uuid_list = [bin(opt) for opt in options]
return protocol.setNodeState(uuid_list, protocol.DOWN_STATE, 1)
action_dict = {
'print': {
'pt': printPTAction,
......@@ -140,10 +152,11 @@ action_dict = {
'node': setNodeAction,
'cluster': setClusterAction,
},
'add': addAction,
'start': {
'cluster': startCluster,
}
},
'add': addAction,
'drop': dropNode,
}
class Application(object):
......
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