This layout is closer to what most python modules have nowadays.
It also simplifies testing and static analysis setup.
Keep virt-* wrappers locally, for ease of running these commands
from a git checkout.
Adjust the wrapper binaries we install on via packaging to be
pure python, which makes things like running gdb easier.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Commit <53f075ab76e1c372474ae0d88f202e487d9f213f> added a warning if the
VM XML is not changed after removing default devices but the code was
incorrect. We have to compare strings instead of string vs Guest object
and also the condition was inverted.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Init a shared log instance in virtinst/logger.py, and use that
throughout the code base, so we aren't calling directly into
'logging'. This helps protect our logging output from being
cluttered with other library output, as happens with some
'requests' usage
Not sure I want to go down that route if we can avoid it. Instead
just fold the full_id support into the existing option handling.
Streamline the OSVariantData usage throughout the cli tools
Add support for starting the domain. By default, first the domain is
defined and then started. If the `--start` is used in combination with
`--no-define` a transient domain is created without persisting the
changes in the persistent domain definition.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Add `--no-define` argument. It's mutually exclusive to the `--define`
argument and later on it allows the user to start a domain
transiently.
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
The option only works with --add-device for the time being,
so we prevent its use in all other cases.
It would be nice to have it work with --build-xml too, but
in that case the user would have to provide some extra
information that in the case of --add-device we can figure
out from the existing guest, and it's not entirely clear
whether that would even be that useful, so for now we're
not considering that case at all.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
We're not doing anything with it yet, but having the
parser accept it means we can write tests and see how
their output changes once we wire it up in earnest.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
The copyright headers in every file were chjanged in this previous commit
commit b6dcee8eb7
Author: Cole Robinson <crobinso@redhat.com>
Date: Tue Mar 20 15:00:02 2018 -0400
Use consistent and minimal license header for every file
Where before this they said "
"either version 2 of the License, or (at your option) any later version."
Now they just say
"GNU GPLv2"
This fixes it to say "GNU GPLv2 or later" again.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
The way we enumerate devices doesn't conform with the way all
other XMLBuilder instances expose child objects. Move more towards
that direction.
This requires some virt-xml and cli.py hacks but we will remove those
in future patches
Fix all E125:
Continuation line with same indent as next logical line
Also remove ignore options of E125
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
Only initialize VirtCLIParser at actual parse time. The data that's
passed to __init__ is the particular data for that parse task, like
the option string, and the Guest object we are editing.
As a result we can drop the whole parsermap handling, since the
parserlist is immutable.
There's a bunch of other reworks mixed in like dropping the
VirtOptionString abstraction...