History | View | Annotate | Download (46.9 kB)
Fix unused imports or add silences where needed
In some cases pylint doesn't parse the import correctly, so we addsilences; but there are also many cases of unused imports, which wesimply remove.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
Remove more unused variables
This removes unused variables in the rest of the code (outside lib/).
Add targeted pylint disables
This patch should have only:
- pylint disables- docstring changes- whitespace changes
Command line/RAPI support for --no-name-check
This patch adds --no-name-check to gnt-instance add and gnt-backupimport. This is opposite to the opcode parameter (name_check) as it issimilar to ip_check and start.
It also adds it to RAPI and gnt-instance batch-create as a parameter in...
Remove quotes from CommaJoin and convert to it
This patch removes the quotes from CommaJoin and converts most of thecallers (that I could find) to it. Since CommaJoin does str(i) for i inparam, we can remove these, thus simplifying slightly a few calls....
A couple of doc updates
Clarify the fact that temporary HV/BE params in instance start overrideand do not extend the configured parameters; and change the instancelist headers from HVM_* to * since many of the parameters apply to KVMtoo. Also fix a typo in the rapi documention for '/2/nodes'....
Fix gnt-instance list documentation
(1) Both the man page and the online help report the link and modefields, which are in the code called nic_link and nic_mode.(2) Add missing fields to the online help.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
Convert the rest of the OpPrereqError users
This finishes the conversion of OpPrereqError creation to two-argumentstyle. Any leftovers as one-argument are not breaking anything, justlosing information about the errors.
Signed-off-by: Iustin Pop <iustin@google.com>...
gnt-* use the correct opcode slot to build opcodes
gnt-* scripts were building wrong opcodes for commands which had theshutdown_timeout slot (due to missing testing after renaming). Fixing.
Also change SHUTDOWN_TIMEOUT_OPT dest field name to "shutdown_timeout":...
Add timeout options to other LUs
All the LUs that shut down the instance need to be able too pass thetimeout parameter as well.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Accept shutdown timeout from the user
Using the new --timeout option:
- gnt-instance shutdown is changed to accept a timeout- the opcode is changed to hold one- the LU is changed to optionally get one- the rpc is changed to carry one- the backend is changed to take it as a parameter rather than...
Allow --force-variant for instance add/reinstall
Passing this option makes an undeclared variant be passed to the os "asis", hoping it'll be able to figure it out (as per the design doc).
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
Update client os lists to name+variant format
List of OSes are displayed by gnt-os list, rapi, and gnt-instancereinstall --select-os, and checked by burnin. In all of these show thelist with name+variant, if the os has variants.
Implement uuid in gnt-node/instance list and info
The patch modifies LUQueryInstanceData to return the uuid too and alsoadds support for it in the gnt-* scripts.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
gnt-instance info: fix nic display
In branch-2.1 the conversion of NICs to Tuples has been unified to the_NICListToTuple function, which is used by both hook generation andinstance info generation. Unfortunately the ip and mac fields gotswapped from what instance info expected, so the mac is shown as ip, and...
Unify the instance creation code
Currently the AddInstance in gnt-instance and ImportInstance ingnt-backup duplicate all of their code except the actual opcode creation(the parameters to it). By moving this to cli.py (not optimal location,but we don't have another one), we can use a single copy of the code,...
Unify multi-instance handling in gnt-instance
Start, stop and reboot have the same code for dealing withmulti-instance handling. This patch moves all that into a single genericfunction, and leaves only the building of the specific opcode for theoperation in the individual functions....
Fix gnt-instance start/stop/… args
The gnt-instance commands that have the multi-filter can take also zeroarguments, if the --all flag is passed. But they currently are declaredwith min=1, and this is a regression due to the recent bash completionchanges....
Move the “--reboot-type” option to cli.py
Move the “--ignore-secondaries” option to cli.py
Change indentation style in commands definitions
Currently, the indentation level for a command's definition depends onthe command name length, and this makes the commands dict unpleasant tothe eye. This patch changes it so that a new line begins right after the...
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.
Move the “--on-primary” option to cli.py
Move the “--on-secondary” option to cli.py
Move the “--auto” option to cli.py
Move the “--ignore-size” option to cli.py
Unify the “--no-ip-check” option
Unify the “--net” option
Unify the “--disk” (identkeyval) option
Unify the “--disks” (disk indices) option
Unify the “--os-size” option
Unify the “--ignore-consistency” option
Unify the “--non-live” option
Unify the “--node” (as instance placement) option
Unify the last “--node” (single node) option
Move the “--no-start” option to cli.py
Move the “--show-cmd” option to cli.py
Move the “--cleanup” option to cli.py
Move the “--static” option to cli.py
Move the “--all” option to cli.py
Move the “--select-os” option to cli.py
Move the “--ignore-failures” option to cli.py
Unify the “--new-secondary” option
Unify the “--disk-template” option
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Unify the “--no-nics” option
Unify the “--file-storage-dir” option
Unify the “--file-driver” option
Unify the “--iallocator” option
This patch also changes the gnt-debug's “--algorithm” intoIALLOCATOR_OPT, since it was the only non-standard use of this (due tohistorical reasons). Since it's just a debug option,backwards-compatibility is not critical here....
Unify the “--os-type” option
This was already unified inside gnt-instance, I just moved thatdefinition (and upper-cased it) into cli.py.
Unify the “--backend-parameters” option
This is not straight-forward. First, gnt-cluster had“--backend-parameters” wheres the rest of the script had just“--backend”. I settled on the full form, since one can always abbreviateoptions, but not vice-versa....
Unify the “--hypervisor” (params only) option
This unifies the two uses of --hypervisor-parameters with only options(a=b,…) form. The patch changes a little SetInstanceParms since thatexpected opts.hypervisor instead of opts.hvparams.
Note that there is another form of --hypervisor-parameters which also...
Unify the “--hypervisor” (with name) option
Unify the “--no-wait-for-sync” option
Add bash completion for --node node1[:node2]
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Luca Bigliardi <shammash@google.com>
Use ReadFile/WriteFile in more places
This survived QA, burnin and unittests.
Add more bash completion metadata for options
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Olivier Tharan <olive@google.com>
Add ArgHost class
It expands to the hostnames known by bash.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Re-introduce constants for most often used arguments
Add more auto-completion metadata
Make all options use cli_option
Change scripts to use new argument definitions
This can be used to generate the bash completion script automatically.In the future it may allow for better command line validation as well.
Add gnt-instance move
This uses the new LUMoveInstance. It supports only single-instance moves.
cli: Merge ikv_option and keyval_option into cli_option
Merging them gets rid of two public functions in cli.py and optparse explicitlysupports more than one option type per class.
Add support for querying the ctime/mtime
This patch adds querying of ctime/mtime for the cluster/nodes/instances.
Implement instance recreate-disks
This can be used for a 'plain' type instance when the underlying storagewent away, to recreate the storage (and reinstall) instead of removingthe instance and readding it.
Merge commit 'origin/next' into branch-2.1
gnt-instance replace-disks: Add new --auto option
Merge branch 'master' into next
Convert ldisk_degraded to tri-state value
This allows us to report “uncertain” states (LDS_UNKNOWN) for caseswhere the code can't easily detect or report what's wrong with ablock device.
objects.BlockDevStatus: Remove ToLegacyStatus
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Implement --ignore-size in activate-disks
This patch modified OpActivateDisks, LUActivateDisks and gnt-instanceactivate-disks to support and pass this option to_AssembleInstanceDisks.
The patch is quite trivial I think; there should be no issues from it...
Fix gnt-instance reinstall
Commit 55efe6dabe48e5c37dc1ff6099e0bb8afde7a468 "Convert instancereinstall to multi instance model" actually broke instance reinstall forsingle-instance cases. This one-liner fixes it.
Fix a couple of epydoc warnings
It seems epydoc needs fully-qualified references, and doesn't deal withrelative ones (not even in the current module) if there are anyambiguities.
There are other epydoc warnings, in the rapi docstrings, but those areleft as-is as they're removed in 2.1....
gnt-instance batch-create: use the job executor
This small patch changed the batch create functionality to use the jobexecutor instead of single-job submits.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>...
Convert instance reinstall to multi instance model
This patch converts ‘gnt-instance reinstall’ from single-instance tomulti-instance model; since this is dangerours, it's required to pass“--force --force-multiple” to skip the confirmation.
Merge branch 'master' into branch-2.1
check_ident_key_val, handle no_ and - prefixes
If an ident member of an IdentKeyVal relationship starts with no_ or -,handle it the same way we do for a key. Some unittests are added tocheck that check_ident_key_val behaves as expected.
This patch also changes ForceDictType to, for now, fail on such an...
Fix some small epydoc warnings
Update gnt-instance batch-create for NIC params
This is compatible with the previous version, but also allows specifyingmore than one nic, by giving a "nics" list of dicts. The two methods(individual fields for the first nic, and list of all nics) areincompatible with each other....
Fix handling of 'vcpus' in instance list
Currently running “gnt-instance list -o+vcpus” fails with a cryptic message: Unhandled Ganeti error: vcpus
This is due to multiple issues: - in some corner cases cmdlib.py raises an errors.ParameterError but this is not handled by cli.py...
Fix QueryInstanceData for nic parameters
This CL updates QueryInstanceData to return NICs in the new format (mac,ip, mode, link) and fixes gnt-instance info to properly display them.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Update instance query for NIC parameters
Compatibility with the old parameters is maintained, by allowing toquery for "bridge" "nic.bridges" and "nic.bridge/N", but None isreturned in that case for routed nics.
Show disk size in instance info
The size of the instance's disk was not shown in “gnt-instance info”.This patch adds it and formats it nicely if possible.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Add -H/-B startup parameters to gnt-instance
This patch modifies the start instance script, opcode and logical unitto support temporary startup parameters.
Different from 1.2, where only the kernel arguments were supportingchanges (and thus xen-pvm specific), this version supports changing all...
Remove an unused function
The _TransformPath function is not used anymore in 2.0, let's remove it.
gnt-instance info --all
Don't show all instances info by default, but require --all to be passedfor this time consuming operation.
Reviewed-by: iustinp
A bunch of doc and other small fixes
This patch adds a couple of both externally and internally reportedissues: - missing SGML tags (Issue 54), report and patch by superdupont - wrong variable used in the init.d script, report and patch by Karsten Keil <karsten-keil@t-online.de>...
Disable synchronous (locking) queries
This patch raises an error in the master daemon in case the userrequests a locking query; accordingly, all clients were modified to sendonly lockless queries. This is short-term fix, for proper fix theclients should be modified to submit a job when the user request a...
Fix the --net option to gnt-instance add
Similar to the --disk fixes a while ago, --net is broken too. This patchfixes it.
Reviewed-by: imsnah
Remove the extra_args parameter in instance start
This patch removes the extra_args parameter and instead switches theinstance to the HV_KERNEL_ARGS hypervisor option.
This is a big change, but it's a needed cleanup, this extra parameter onall RPC calls is not generic and we also need to have a persistent value...
gnt-instance info: remove hvattr descriptions
Having hvattr descriptions is only confusing for the user, because evenif they explain better what an attribute is about, they don't help indeciding what keyword should be used to actually set it. If in the...
Implement the backward-compatible ‘-s’ disk option
This patch adds back to the instance creation command (gnt-instace add,gnt-backup import) the ‘-s’ short form option for specifying asingle-disk instance.
Also a small bug in gnt-backup import is fixed....
Always use the same short option for iallocator
This patch changes the scripts so that the short name for the“--iallocator” option is always ‘-I’.
Reviewed-by: ultrotter
Some batcher fixes
Currently the batcher hypervisor parameter must be a dict with oneelement (e.g. {"xen-hvm": { "acpi": true }}). This is overly complex andhard to validate correctly; the patch splits it in two: - one "hypervisor" string parameter, with the name of the hypervisor...
gnt-instance fix a typo in AddInstance
It's hvparams, not opts.hvparams.