On Tue, Aug 25, 2015 at 01:56:40PM +0200, 'Bhimanavajjula Aditya' via ganeti-devel wrote: > This allows the user to manually call a repair command > on a specified node with a given input. > > Signed-off-by: Bhimanavajjula Aditya <[email protected]> > --- > lib/cli_opts.py | 6 ++++++ > lib/client/gnt_node.py | 17 +++++++++++++++++ > man/gnt-node.rst | 17 +++++++++++++++++ > 3 files changed, 40 insertions(+) > > diff --git a/lib/cli_opts.py b/lib/cli_opts.py > index 231f9de..5ffb9ba 100644 > --- a/lib/cli_opts.py > +++ b/lib/cli_opts.py > @@ -124,6 +124,7 @@ __all__ = [ > "IGNORE_SOFT_ERRORS_OPT", > "IGNORE_SIZE_OPT", > "INCLUDEDEFAULTS_OPT", > + "INPUT_OPT", > "INSTALL_IMAGE_OPT", > "INSTANCE_COMMUNICATION_NETWORK_OPT", > "INSTANCE_COMMUNICATION_OPT", > @@ -1623,6 +1624,11 @@ LONG_SLEEP_OPT = cli_option( > "--long-sleep", default=False, dest="long_sleep", > help="Allow long shutdowns when backing up instances", > action="store_true") > > +INPUT_OPT = cli_option("--input", dest="input", default=None, > + help=("input to be passed as stdin" > + " to the repair command"), > + type="string") > + > #: Options provided by all commands > COMMON_OPTS = [DEBUG_OPT, REASON_OPT] > > diff --git a/lib/client/gnt_node.py b/lib/client/gnt_node.py > index 22e5107..57922f1 100644 > --- a/lib/client/gnt_node.py > +++ b/lib/client/gnt_node.py > @@ -1040,6 +1040,19 @@ def RestrictedCommand(opts, args): > return exit_code > > > +def RepairCommand(opts, args): > + cl = GetClient() > + if opts.input: > + input = opts.input.decode('string_escape')
Please fix the lint error. ganeti/client/gnt_node.py:1046: [W0622, RepairCommand] Redefining built-in 'input' -- Klaus Aehlig Google Germany GmbH, Dienerstr. 12, 80331 Muenchen Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores
