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

Hardcode node states and types constants suffixes to simplify command line

input. So now use 'set node <uuid> RUNNING', 'print node STORAGE' in neoctl.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@912 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 96d41638
...@@ -68,7 +68,8 @@ def setNodeAction(options): ...@@ -68,7 +68,8 @@ def setNodeAction(options):
If given with a 1 value, allow partition table to be changed. If given with a 1 value, allow partition table to be changed.
""" """
uuid = bin(options.pop(0)) uuid = bin(options.pop(0))
state = node_states.getFromStr(options.pop(0)) state = options.pop(0) + '_STATE'
state = node_states.getFromStr(state)
if state is None: if state is None:
raise ActionError('unknown state type') raise ActionError('unknown state type')
if len(options): if len(options):
...@@ -90,7 +91,8 @@ def printNodeAction(options): ...@@ -90,7 +91,8 @@ def printNodeAction(options):
node type node type
Print known nodes of given type. Print known nodes of given type.
""" """
node_type = node_types.getFromStr(options.pop(0)) node_type = options.pop(0) + '_NODE_TYPE'
node_type = node_types.getFromStr(node_type)
if node_type is None: if node_type is None:
raise ActionError('unknown node type') raise ActionError('unknown node type')
return protocol.askNodeList(node_type) return protocol.askNodeList(node_type)
......
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