This subcommand is for testing the functionality of repair command. This patch should not be pushed to the official repo.
Signed-off-by: Bhimanavajjula Aditya <[email protected]> --- lib/client/gnt_node.py | 13 +++++++++++++ man/gnt-node.rst | 8 ++++++++ 2 files changed, 21 insertions(+) diff --git a/lib/client/gnt_node.py b/lib/client/gnt_node.py index 22e5107..596c670 100644 --- a/lib/client/gnt_node.py +++ b/lib/client/gnt_node.py @@ -1040,6 +1040,15 @@ def RestrictedCommand(opts, args): return exit_code +def RepairCommand(opts, args): + cl = GetClient() + op = opcodes.OpRepairCommand(command=args[0], node_name=args[1], + input="Test Input\n") + result = SubmitOrSend(op, opts, cl=cl) + print result + return constants.EXIT_SUCCESS + + class ReplyStatus(object): """Class holding a reply status for synchronous confd clients. @@ -1249,6 +1258,10 @@ commands = { [SYNC_OPT, PRIORITY_OPT] + SUBMIT_OPTS + [SHOW_MACHINE_OPT, NODEGROUP_OPT], "<command> <node_name> [<node_name>...]", "Executes a restricted command on node(s)"), + "repair-command": ( + RepairCommand, [ArgUnknown(min=1, max=1), ArgNode(min=1, max=1)], + [SUBMIT_OPT], "<command> <node_name>", + "Executes a repair command on a node"), } #: dictionary with aliases for commands diff --git a/man/gnt-node.rst b/man/gnt-node.rst index 71b6fd7..74e87ec 100644 --- a/man/gnt-node.rst +++ b/man/gnt-node.rst @@ -647,6 +647,14 @@ The ``-M`` option can be used to prepend the node name to all command output lines. ``--sync`` forces the opcode to acquire the node lock(s) in exclusive mode. +REPAIR-COMMAND +~~~~~~~~~~~~~~~~~~ + +| **repair-command** +| *command* *node* } + +Executes a repair command. + Tags ~~~~ -- 2.5.0.457.gab17608
