6186 Commits

Author SHA1 Message Date
Cole Robinson
f035f313a4 osdict: Absorb get_kernel_url_arg from urldetect
Since nowadays it's entirely a function of the detected OS name
2019-02-03 12:05:18 -05:00
Cole Robinson
41b276ffcd installertreemedia: Don't carry around _Distro internally
Detect the distro, and pull out all the data we need into an internal
cache. This will simplify future improvements
2019-02-03 12:05:18 -05:00
Cole Robinson
bcb13bfbfa tests: test_urls: Add some additional failure cases 2019-02-03 12:05:18 -05:00
Cole Robinson
f7619cdcda tests: test_urls: Use installer, not _Distro directly 2019-02-03 12:05:18 -05:00
Cole Robinson
137be83232 cli: Use VirtCLIParser for --location
No-op change for now, just adds a default subopt location=. But
more subopts will be added in the future
2019-02-03 12:05:18 -05:00
Cole Robinson
71c9ff487a installer: Modernize the docstring 2019-02-03 12:05:18 -05:00
Cole Robinson
c20e78926b installer: Drop check_location
detect_distro does it all already nowadays, so there's no
real reason to have a separate entry point.
2019-02-03 12:05:18 -05:00
Cole Robinson
4b54b281b9 setup: Remove vestiges of test_urls --path option 2019-02-03 12:05:18 -05:00
Cole Robinson
b4cddb338b urldetect: Fix rhel8 detection
Internally rhel8 versions are now 8.0.0, so adjust our version check
2019-02-03 12:05:18 -05:00
Cole Robinson
665607fdc2 urldetect: Add a class for libosinfo detection
If an ISO path is used for --location, prioritize asking libosinfo
for the os_variant and kernel/initrd paths.

This fixes some instances that we lost when GenericDistro was dropped,
like using various netinst/boot.isos around

Example: https://github.com/virt-manager/virt-manager/pull/39
2019-02-03 12:05:18 -05:00
Cole Robinson
2b4e1cadf3 osdict: Rename lookup_os_by_media to guess_os_by_iso
And have it return the media object up to the caller
2019-02-03 12:05:18 -05:00
Cole Robinson
3d8b41c7bb urldetect: Renaming Distro to _DistroTree
And all child distros to match. 'Distro' is too generic, and
now they can be made private
2019-02-03 12:05:18 -05:00
Cole Robinson
7f5a969afc clitest: Replace skip_check with skip_cb
So we can return a message to help debug why tests were skipped
2019-02-03 12:05:18 -05:00
Cole Robinson
5df6bc2ba5 test_urls: Drop comparison against _Distro class
Future changes to use libosinfo more are going to break
this. Comparing against detected os_variant should be
mostly sufficient
2019-02-03 12:05:18 -05:00
Cole Robinson
9e4287321f urlfetcher: Drop explicit prepare/cleanup calls
We can do this automatically easily enough. The downsides of
not cleaning up are pretty minor these days anyways without
the 'mount' handling
2019-02-03 12:05:18 -05:00
Cole Robinson
9995ebc86b urldetect: Kill acquireKernel
Decompose it into a helper to probe for available kernel paths, but leave
the actual file fetching up to the installer class
2019-02-03 12:05:18 -05:00
Cole Robinson
e2edcc559d urldetect: Fix comment typo 2019-02-03 12:05:18 -05:00
Cole Robinson
e1568e39a3 urlfetcher: Simplify make_full_url 2019-02-03 12:05:18 -05:00
Cole Robinson
012a4e8ef5 urldetect: Centralize _get_kernel_url_arg implementation
Future changes will make more use of libosinfo, which means we
won't end up in some of the *Distro classes. So move the
get_kernel_url_arg logic into the parent Distro class, so it's
more easily shared.
2019-02-03 12:05:18 -05:00
Cole Robinson
66e89f020b urldetect: rename _set_kernel_paths to _set_manual_kernel_paths 2019-02-03 12:05:18 -05:00
Cole Robinson
a7be538003 urldetect: Centralize setting _kernel_paths from treeinfo 2019-02-03 12:05:18 -05:00
Cole Robinson
79345369a7 urldetect: Add _set_kernel_paths class override
All __init__ calls essentially are just filling in _kernel_paths.
Make it explicit
2019-02-03 12:05:18 -05:00
Pino Toscano
bce4cc4ef8 inspection: fix check of null icon
Recently the Python binding of libguestfs was adapted to properly use
bytes in APIs that return data, instead of (ab)using strings [1].
This change was done only when built for Python 3, which has this
distinct bytes and strings.

Because of that, now the 'icon == ""' (empty string) checks fail, using
whatever inspect_get_icon() returns, including empty arrays of bytes.
Hence, change the checks to use the length of the data as condition, as
also the libguestfs Python API documentation says.  Leave also the
checks for None, in the remote case the API will return None in the
future for no data.

[1] 0ee02e0117
2019-01-30 18:06:26 -05:00
Cole Robinson
e79143f3a6 setup.cfg: Drop unicode, it upsets CI 2019-01-30 18:01:20 -05:00
Cole Robinson
a9f818b44b pycodestyle: Only use format=pylint from setup.py
Don't force it on users who are running the tool manually
2019-01-30 17:25:14 -05:00
Cole Robinson
8502b84dbd Move tests.pycodestyle.cfg to setup.cfg
This makes manual pycodestyle calls pick up our project config
2019-01-30 17:25:14 -05:00
Cole Robinson
90603cdc6e Move tests/pylint.cfg to pylintrc
This makes manual pylint calls pick up our project config
2019-01-30 17:25:14 -05:00
Ken Dreyer
fe2564530a doc: update Fedora versions
Fedora 20 and 25 are end-of-life. Update to a modern Fedora version.
2019-01-29 10:37:59 -05:00
Pavel Hrdina
943b2a400e details: allow to remove video device if it's not the last one
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1659354

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-01-28 17:55:38 +01:00
Cole Robinson
9b2e6886d0 disk: Fix virt-xml --add-device --disk size=X 2019-01-22 10:32:23 -05:00
Christian Borntraeger
c82042245b virt-install: fix SLES11 installation on s390x
self._os_variant returns sles11sp4 sles11sp3 and so on.
Lets match those as well to pickup the right kernels.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-21 15:41:24 -05:00
Kenyon Ralph
957815397d virt-install.pod: make example command match commentary
The example commentary says Fedora 20, so make the command line match that.
2019-01-21 16:01:02 +01:00
Lin Ma
eadb5b6193 vsockdetails: Show CID for active VM if the attribute auto is set to yes
Signed-off-by: Lin Ma <lma@suse.com>
2019-01-21 13:49:56 +01:00
Slavomir Kaslev
63db4de0b5 Remove Author lines from files
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
2019-01-15 13:55:53 -05:00
Pavel Hrdina
ad77f4fe83 createnet: fix typo introduced by commit dae8642bb
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-01-15 15:55:44 +01:00
Pavel Hrdina
14033113a4 cli: fix typos in virt-install --help output
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1533015

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2019-01-15 14:47:01 +01:00
Lin Ma
bbe4866127 cli: Add function cli_flag_name and use it
It can convert the underscore to minus for cli_arg_name in help
output or error message.

Signed-off-by: Lin Ma <lma@suse.com>
2019-01-14 10:40:54 -05:00
Cole Robinson
7228867480 diskbackend: Fix backtrace cloning with block storage (bz #1661986)
https://bugzilla.redhat.com/show_bug.cgi?id=1661986
2019-01-10 12:58:43 -05:00
Marc Hartmayer
a7ee1b3801 cli: Fix __init_class__
For Python versions < 3.6 it's not possible for the metaclass to call
a method in the defined class that uses super() before it is done with
its __new__ and __init__. Therefore let's workaround this by using
hard coded class names instead of super() in __init_class__. See
https://stackoverflow.com/a/28605694 for more details.

In addition, add missing __init_class__ call to the __init_class__
implementation of _ParserChar.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
2019-01-09 10:04:14 -05:00
Cole Robinson
069653b744 osdict: Drop -unknown mapping for ISO media detection
This was originally added for fedora to give better names in the UI,
but that's a loose reasoning IMO. The pattern was extended to
other -unknown distros but instead of maintaining that going
forward I'd rather just remove the magic for it.
2019-01-08 16:02:34 -05:00
Cole Robinson
c38be50dcb urldetect: Use fedora-unknown more
Instead of the magic to look up latest OS... fedora-unknown is meant
for that usecase.
2019-01-08 16:02:34 -05:00
Cole Robinson
5d287bc2ae test_urls: Disable Fedora dev test, currently invalid 2019-01-08 13:53:35 -05:00
Cole Robinson
6c28f53590 cli; Share --os-variant option registering
And improve the help message for both users
2019-01-08 12:44:53 -05:00
Cole Robinson
2a88d3a1af tests: clitest: Slim down virt-xml --os-variant tests
There's some redundancy here, and let's not depend on test-many-devices
which causes a lot of test suite churn
2019-01-08 12:24:50 -05:00
Cole Robinson
91dd6739c6 uitests: Cover vsock UI 2019-01-08 12:08:56 -05:00
Cole Robinson
0d3babe42b cli: Improve 'Unknown options' error
By mentioning the offending command line option, ex:

$ ./virt-install --boot disk
ERROR    Unknown --boot options: ['disk']
2019-01-08 11:50:36 -05:00
Cole Robinson
2f89ecf4a9 Remove Author lines from file headers
Similar to what was done in libvirt. See these commits:

600462834f
c99e954973
2019-01-08 11:45:35 -05:00
Cole Robinson
d5d4a87723 about: copyright year is 2019 2019-01-08 11:33:58 -05:00
Povilas Kanapickas
23c489e220 console: Extract fullscreen exit code to separate class
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2019-01-07 18:12:29 -05:00
Marc Hartmayer
50633d3329 domain: add docstring for _convert_old_boot_order
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2019-01-07 15:46:01 -05:00