Commit Graph

69 Commits

Author SHA1 Message Date
Charles Arnold
33ae6e51ad virtinst: Fix detection of sle12sp1 media
The installer wrongly detects SLE-12-SP1 media as SLE-12-GA

Signed-off-by: Charles Arnold <carnold@suse.com>
2016-06-07 11:01:09 -04:00
Charles Arnold
2647f699fb virtinst: Fix detection of openSUSE tumbleweed media
With Tumbleweed now part of libosinfo we do not need to default
to openSUSE 13.2 when pointing at the installation media.

Signed-off-by: Charles Arnold <carnold@suse.com>
2016-06-07 11:01:09 -04:00
Leno Hou
82432dc339 urlfetcher: Enable Ubuntu 16.04 s390x detection
Signed-off-by: Leno Hou <lenohou@gmail.com>
CC: Kevin Zhao <kevin.zhaoshuai@gmail.com>
2016-04-26 08:13:46 -04:00
Cole Robinson
f4dfb6de9d Fix recent pylint/pep8 output 2016-04-18 16:42:12 -04:00
Cole Robinson
f4bf4ef349 urlfetcher: Don't set os_variant=linux
os_variant=linux is basically meaningless; it doesn't set any useful
defaults. better to be explicit that we didn't detect any meaningful
os_variant, to trigger the virt-install warning
2016-04-07 17:43:53 -04:00
Cole Robinson
b45f676086 urlfetcher: Make fedora detection more robust 2016-04-07 17:29:42 -04:00
Cole Robinson
97b5961506 urlfetcher: Fix rawhide URL detection (bz 1322011) 2016-04-07 17:20:18 -04:00
Cole Robinson
c92507baea urlfetcher: Fix ftp URLs with ports in them
Reported-by: int-0 <tobias.deb@gmail.com>
2016-03-24 16:15:21 -04:00
Cole Robinson
d3b9fcf3de Fix some pylint 2016-03-24 16:04:06 -04:00
Cole Robinson
d32e5c7e27 urlfetcher: Support latest Mageia
The kernel paths changes
2016-03-24 15:57:34 -04:00
Cole Robinson
351e6b9562 urlfetcher: Fix detection of latest SL 6
They changes the treeinfo family to just be 'Scientific'
2016-03-24 15:57:34 -04:00
Cole Robinson
1c7a91385d urlfetcher: Fix distro detection with http->https redirects
Need to tell requests.head request to follow the redirect automatically,
otherwise the 301 response throws us off.

Saw this with http://d-i.debian.org/
2016-03-24 15:57:34 -04:00
Cole Robinson
af5a86742c urlfetcher: Add unconditional hasFile logging 2016-03-24 14:51:36 -04:00
Pavel Hrdina
4c3e7969c6 virt-install: concatenate all extra-args argument
So far we used only the last --extra-args argument from virt-install
command line, but it makes more sense to use all occurrences of
--extra-args and pass them to kernel.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2016-03-18 03:28:17 +01:00
Cole Robinson
eae7dc0619 urlfetcher: Fix URL installs when content-length header missing
Suggested-by: bduff@sjm.com
2016-01-12 12:45:02 -05:00
Cole Robinson
8700fda757 urlfetcher: Fix ubuntu url detection with latest libosinfo 2015-11-24 21:59:23 -05:00
Pavel Hrdina
4578a4ec0f virt-install: use correct path for linux and initrd for SLES on ppc64
Install DVD of SLES for ppc64 has different path where linux and initrd
are located.  Add those paths to kernel_paths to search also there, in
case we are installing SLES on ppc64 host.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1270430

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2015-11-02 17:40:35 +01:00
Giuseppe Scrivano
c0a27bb9b4 urlfetcher: Recognize RHEL Atomic Host ISOs
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1268001

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2015-10-05 21:54:30 +02:00
Cole Robinson
b520a659a3 urlfetcher: Add some debugging to debian distro detection 2015-09-23 18:21:26 -04:00
Cole Robinson
5584863d18 urlfetcher: Switch to requests and urllib2 instead of urlgrabber
urlgrabber is largely dead upstream and isn't going to be ported to
python3 AFAIK. So we will need to move off of it eventually.

Use requests for http handling which is the most common library nowadays,
and just plain old urllib2 for ftp fetching.
2015-09-18 19:50:35 -04:00
Cole Robinson
9a4f15f4ad urlfetcher: Rework early treeinfo lookup
We are duplicating the regex checks which I don't like. So just grab
the treeinfo early, and use that during the main distro lookup
2015-09-18 18:01:57 -04:00
Cole Robinson
b7beb0edb0 urlfetcher: Use python style tempfiles
Simplifies things WRT writing file contents
2015-09-18 17:11:37 -04:00
Cole Robinson
cda3e381e6 urlfetcher: Bunch of small cleanups to the ImageFetcher classes 2015-09-18 17:08:34 -04:00
Cole Robinson
590f5a525b urlfetcher: Clear cached ftp connection on cleanupLocation
Reported-by: Chun Yan Liu <cyliu@suse.com>
2015-09-14 10:34:19 -04:00
Charles Arnold
360fe11040 virtinst: correctly find the sles s390x kernel and initrd
Allow virt-install to correctly find the SLES kernel/initrd on the media
when installing an s390x VM.

Signed-off-by: Charles Arnold <carnold@suse.com>

(crobinso: fix minor pep8 issues)
2015-09-11 12:48:52 -04:00
Cole Robinson
03c24ca5cb Fix a pylint warning 2015-06-05 16:31:07 -04:00
Lin Ma
5618fa4c5d urlfetcher: Add support for detecting os variants of suse distros
Detect os variants information based on content file

From: Charles Arnold <carnold@suse.com>
Signed-off-by: Lin Ma <lma@suse.com>
2015-06-05 16:00:19 -04:00
Lin Ma
23f262ec7c urlfetcher: Fetch URL media from content file for suse distros
SUSE distro includes a file named content, It includes media information.
This patch adds the ability that fetching url media information through this file.

From: Charles Arnold <carnold@suse.com>
Signed-off-by: Lin Ma <lma@suse.com>
2015-06-05 16:00:19 -04:00
Charles Arnold
9ea3fcd1fc urlfetcher: Add classes for SUSE distros
Signed-off-by: Lin Ma <lma@suse.com>
2015-06-05 16:00:19 -04:00
Cole Robinson
dcfce5585a osdict: If detecting fedora-unknown, convert to latest fedora
That's basically what it is internally for libosinfo, and it helps
us generate better names in virt-manager
2015-04-13 17:07:16 -04:00
Cole Robinson
393aed191e urlfetcher: Detect centos URLs as centos, not rhel variants 2015-04-04 15:41:13 -04:00
Cole Robinson
bd9ab2d5b5 osdict: Add toplevel OSDB as API entry point
Makes code more readable, and lazy loading simpler.
2015-04-04 12:06:41 -04:00
Cole Robinson
82e9684fa6 urlfetcher: Make debian treearch checking more generic
Use regex parsing rather than a whitelist
2015-03-27 13:06:26 -04:00
Mauricio Faria de Oliveira
0dc334fa58 Add ppc64el support for 'virt-install --location' (Debian/Ubuntu)
The installation of Debian/Ubuntu for ppc64el (a.k.a. ppc64le on Fedora/RHEL)
fails with 'virt-install --location', as the arch dir and kernel filename
are not correct for this arch/distros.

This patch fixes it by adding checks for 'treeArch' and 'hvm_kernel_paths'.

Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
2015-03-27 12:30:04 -04:00
Cole Robinson
6871ee0c91 urlfetcher: Hint at the user if URL appears unaccessible 2014-12-10 13:57:10 -05:00
Gabriel de Perthuis
24faf86750 URL installs: remove hasFile("") check
Specialised proxies like apt-cacher-ng disallow directory listing.
OSDistro subclasses do have checks for known files and they are
sufficient.
2014-12-10 13:46:11 -05:00
Cole Robinson
be3787f2d1 urlfetcher: Detect RHEL ARM distro from treeinfo 2014-11-20 19:15:11 -05:00
Chen Hanxiao
a6e72f30f3 virtinst: fix some comment typos
s/occurence/occurrence

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-10-29 16:00:28 +08:00
Cole Robinson
86417d42ca osxml: Ensure kernel/initrd/dtb are absolute paths 2014-09-23 14:32:01 -04:00
Cole Robinson
eb7612356e virtinst: Switch to relative imports, fix cyclic import warnings 2014-09-12 16:28:38 -04:00
Cole Robinson
d8d6af55e5 distroinstaller: Cache fetcher and distro store lookups
Since we already determine the distro store ahead of time via
check_location and detect_distro, cache the result in the installer
class to save us some network traffic.
2014-09-07 14:40:09 -04:00
Cole Robinson
050d0fb16e urlfetcher: Make fetcher cleanup idempotent 2014-09-07 14:22:56 -04:00
Cole Robinson
faa0ef5e55 urlfetcher: Point to man page if location URL is invalid 2014-09-07 14:01:40 -04:00
Cole Robinson
46e135c7a1 urlfetcher: Remove outdated comment 2014-09-07 13:59:54 -04:00
Cole Robinson
2e7d477156 urlfetcher: Bunch of distro detection fixes
And update test_urls to ensure it's passing
2014-09-06 16:42:09 -04:00
Ron
ea1d973957 Don't create disk images world readable and executable
Python's os.open() defaults to mode 0777 if not explicitly specified.
Disk image files don't need to be executable, and having them world
readable isn't an ideal situation either.  Owner writable and group
readable is probably more than sufficient when initially creating
them.

Signed-off-by: Ron Lee <ron@debian.org>
2014-07-02 07:35:15 +02:00
Chen Hanxiao
7ce434fed7 urlfetcher: fix a comment typo
s/Explictly/Explicitly

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
2014-06-30 10:58:53 +08:00
Giuseppe Scrivano
1d312a520e virtinst: early detect ftp connection errors
It fixes two problems:

i) "ftp://" was accepted as valid URL but then it causes this
exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/ftplib.py", line 387, in login
    resp = self.sendcmd('USER ' + user)
  File "/usr/lib64/python2.7/ftplib.py", line 243, in sendcmd
    self.putcmd(cmd)
  File "/usr/lib64/python2.7/ftplib.py", line 178, in putcmd
    self.putline(line)
  File "/usr/lib64/python2.7/ftplib.py", line 173, in putline
    self.sock.sendall(line)
AttributeError: 'NoneType' object has no attribute 'sendall'

ii) only a cryptic error message "Unable to complete install: '[Errno
-2] Name or service not known'" was showed to users when the DNS
lookup failed.  The exception is now intercepted and decorated with
more information.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1086554

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-04-14 15:20:18 +02:00
Giuseppe Scrivano
db6d001b0e tests: fix to not fail with libosinfo
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2014-03-24 12:40:42 +01:00
Cole Robinson
797afb3b27 virt-install: Fix --location iso again, and test it (bz 1071513) 2014-03-06 12:46:46 -05:00