History | View | Annotate | Download (17.7 kB)
Querying node groups: add client/gnt_group.py
This implements `gnt-group list`.
Signed-off-by: Adeodato Simo <dato@google.com>Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add nodegroup bash autocomplation
We autocomplete both by nodegroup name and uuid.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
cli: Use list of options shared between commands
The completion script for bash has to know about these options. Until nowthe list was in two places--once in cli.py and once inautotools/build-bash-completion. A shared list is used with this patch.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
Move ShellWriter class to utils
Also add unittest.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Introduce a bool CLI option type
This option type enforces its value to either True or False, relievingthe scripts from manually parsing the values in each function.
We also update the bash completion code to use the option type ifpossible.
Signed-off-by: Iustin Pop <iustin@google.com>...
cli: Add ArgOs for later use in gnt-os
Signed-off-by: René Nussbaumer <rn@google.com>Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
build-bash-completion: Take care of pylint warnings
build-bash-completion: Fix a few pylint warnings
build-bash-completion: Check for None before comparing
Comparing a number with None is not a good idea:
>>> (0 < None, 0 > None) (False, True)
This patch also adds build-bash-completion to the listof checked Python scripts and wraps one line of more...
bash_completion: Move common code into function
This reduces the size of the script by about 9 kB.
Remove explicit DEBUG_OPT and add it by default
Since >90% of the commands take the “--debug” option, and all shouldactually take it (the gnt-job command is currently missing it), it makessense to simply remove this and add it by default in cli.py.
Show "--help" in bash completion
Move LoadModule function to ganeti.build
It should only be used at build-time.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Add bash completion for --node node1[:node2]
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Luca Bigliardi <shammash@google.com>
Add more debugging to bash completion
Move LoadModule function to utils
It can be used by unittests for daemons/* or scripts/*.
Bash completion: Implement dynamic option value completion
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
Bash completion: Add function to get all iallocators
Bash completion: Simplify option completion
This makes the output file quite a bit smaller and is neededin preparation for non-static option completion (e.g. list ofnodes).
Bash completion: Support for --foo=bar option format
That is with the equal sign.
Bash completion: Small optimizations
$2 doesn't contain the correct value when completing something like"--disk-template=…". Getting it via COMP_WORDS is better.
Short options (e.g. -I) can't have an equal sign.
Also add useful debugging commands for development....
bash completion: Allow arguments with min < max arguments
Handle more errors in bash completion
Don't print error messages if cluster hasn't been initialized yet.
Add ArgHost class
It expands to the hostnames known by bash.
Use script to generate bash completion
Completion for tools/burnin is not yet implemented. It needs to beconverted to definition-based options handling first.