LGTM, thanks

On Tue, Feb 18, 2014 at 3:39 PM, Hrvoje Ribicic <[email protected]> wrote:

> This patch allows the opcode option to be used through the gnt-debug
> client.
>
> Signed-off-by: Hrvoje Ribicic <[email protected]>
> ---
>  lib/client/gnt_debug.py | 7 ++++++-
>  man/gnt-debug.rst       | 8 +++++++-
>  2 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/lib/client/gnt_debug.py b/lib/client/gnt_debug.py
> index f557d59..229b3b3 100644
> --- a/lib/client/gnt_debug.py
> +++ b/lib/client/gnt_debug.py
> @@ -64,7 +64,8 @@ def Delay(opts, args):
>    op = opcodes.OpTestDelay(duration=delay,
>                             on_master=opts.on_master,
>                             on_nodes=opts.on_nodes,
> -                           repeat=opts.repeat)
> +                           repeat=opts.repeat,
> +                           interruptible=opts.interruptible)
>    SubmitOrSend(op, opts)
>
>    return 0
> @@ -629,6 +630,10 @@ commands = {
>                  action="append", help="Select nodes to sleep on"),
>       cli_option("-r", "--repeat", type="int", default="0", dest="repeat",
>                  help="Number of times to repeat the sleep"),
> +     cli_option("-i", "--interruptible", default=False,
> dest="interruptible",
> +                action="store_true",
> +                help="Allows the opcode to be interrupted by using a
> domain "
> +                     "socket"),
>       DRY_RUN_OPT, PRIORITY_OPT] + SUBMIT_OPTS,
>      "[opts...] <duration>", "Executes a TestDelay OpCode"),
>    "submit-job": (
> diff --git a/man/gnt-debug.rst b/man/gnt-debug.rst
> index c6a637d..8dd8650 100644
> --- a/man/gnt-debug.rst
> +++ b/man/gnt-debug.rst
> @@ -46,7 +46,8 @@ this framework, see the HTML or PDF documentation.
>  DELAY
>  ~~~~~
>
> -**delay** [\--debug] [\--no-master] [-n *NODE*...] {*duration*}
> +**delay** [\--debug] [\--no-master] [\--interruptible] [-n *NODE*...]
> +{*duration*}
>
>  Run a test opcode (a sleep) on the master and on selected nodes
>  (via an RPC call). This serves no other purpose but to execute a
> @@ -56,6 +57,11 @@ The ``-n`` option can be given multiple times to select
> the nodes
>  for the RPC call. By default, the delay will also be executed on
>  the master, unless the ``--no-master`` option is passed.
>
> +The ``--interruptible`` option allows a running delay opcode to be
> +interrupted by communicating with a special domain socket. If any data
> +is sent to the socket, the delay opcode terminates. If this option is
> +used, no RPCs are performed, but locks are still acquired.
> +
>  The *delay* argument will be interpreted as a floating point
>  number.
>
> --
> 1.9.0.rc1.175.g0b1dcb5
>
>

Reply via email to