virt-manager/virtinst-add-sle15-detection-support.patch
Charles Arnold c085d819a8 - Update to virt-manager 1.5.0 (bsc#1027942)
virt-manager-1.5.0.tar.bz2
  * python3 prep work (Radostin Stoyanov, Cole Robinson, Cédric Bosdonnat)
  * Switch –location ISO to use isoinfo (Andrew Wong)
  * virt-install: add –cpu numa distance handling (Menno Lageman)
  * virt-install: fix –disk for rbd volumes with auth (Rauno Väli)
  * virt-install: add –cputune vcpupin handling (Wim ten Have)
  * details ui: Showing attached scsi devices per controller (Lin Ma)
  * network ui: Show details about SR-IOV VF pool (Lin Ma)
  * Greatly expand UI test suite coverage
- Dropped patches
  0001-Improve-container-image-url-example.patch
  0001-py3-store-exception-variables-for-use-outside-except.patch
  0002-create-wizard-fix-alignment-in-os-container-page.patch
  0003-oscontainer-ask-root-password-in-the-wizard.patch
  0004-Harmonize-invisible_char-values.patch
  083dfcc8-Show-details-about-the-network-of-SR-IOV-VF-pool.patch
  08a58d61-pycodestyle-remove-description-of-fixed-errors.patch
  0c6bcb09-fix-bytes-string-mess-in-serial-console.patch
  0e812e3c-dont-skip-authentication-for-listen-type-none-with-fixed-QEMU.patch
  23aaf852-network-Set-bridge-name-to-None-instead-of-blank.patch
  2d276ebe-progress-dont-overwrite-format.patch
  2eb455c9-correctly-calculate-virtio-scsi-controller-index.patch
  374a3779-urlfetcher-write-test-file-as-binary-content.patch
  37ea5207-replace-StandardError-with-Exception.patch
  3b769643-dont-add-URI-into-params-for-tunneled-migration.patch
  3be78d1f-addhardware-dont-allow-panic-option-where-not-supported.patch
  44de92b7-use-reload-from-imp-module.patch
  63fce081-pycodestyle-Use-isinstance-for-type-checking.patch
  67122615-python2to3-division-compatability.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=406
2018-02-07 16:59:50 +00:00

128 lines
5.9 KiB
Diff

References: bsc#1054986
With SLE15 and openSUSE 15 the content file has been removed from the media.
This file was used for SUSE distro version and arch detection. Now detection
must be done by parsing the .treeinfo file.
We must continue to keep the content parsing code for the older distros.
As a fallback, detection is also setup to look at the media.1/products and
media.1/build files.
Index: virt-manager-1.5.0/virtinst/urlfetcher.py
===================================================================
--- virt-manager-1.5.0.orig/virtinst/urlfetcher.py
+++ virt-manager-1.5.0/virtinst/urlfetcher.py
@@ -416,7 +416,23 @@ def _distroFromSUSEContent(fetcher, arch
try:
cbuf = fetcher.acquireFileContent("content")
except ValueError:
- return None
+ try:
+ # If no content file, try media.1/products and media.1/build and create
+ # a cbuf with enough info for the content file parsing code below to work
+ pbuf = fetcher.acquireFileContent("media.1/products").strip()
+ pbuf = pbuf.split(' ', 1)[1].strip()
+ # The media.1/products file naming convention changed between SLE11 and SLE12
+ if pbuf.startswith('SLE'):
+ pbuf = pbuf.split(' ')[0]
+ pbuf = " ".join(re.split('(\d+)', pbuf, 1))
+ cbuf = "\nDISTRO ," + pbuf.replace('-', ' ')
+ try:
+ bbuf = fetcher.acquireFileContent("media.1/build").split('-')
+ except:
+ bbuf = ["x86_64"]
+ cbuf = cbuf + "\n" + " ".join(bbuf)
+ except ValueError:
+ return None
distribution = None
distro_version = None
@@ -489,7 +505,7 @@ def _distroFromSUSEContent(fetcher, arch
dclass = GenericDistro
if distribution:
if re.match(".*SUSE Linux Enterprise Server*", distribution[1]) or \
- re.match(".*SUSE SLES*", distribution[1]):
+ re.match(".*SUSE SLES*", distribution[1]) or re.match("SLES*", distribution[1]):
dclass = SLESDistro
if distro_version is None:
distro_version = _parse_sle_distribution(distribution)
@@ -505,10 +521,13 @@ def _distroFromSUSEContent(fetcher, arch
dclass = CAASPDistro
if distro_version is None:
distro_version = ['VERSION', distribution[1].strip().rsplit(' ')[6]]
- elif re.match(".*openSUSE.*", distribution[1]):
+ elif re.match(".*openSUSE.*", distribution[1]) or re.match("openSUSE *", distribution[1]):
dclass = OpensuseDistro
if distro_version is None:
- distro_version = ['VERSION', distribution[0].strip().rsplit(':')[4]]
+ if ':' in distribution[0]:
+ distro_version = ['VERSION', distribution[0].strip().rsplit(':')[4]]
+ else:
+ distro_version = ['VERSION', distribution[1].strip().rsplit(' ')[2]]
if distro_version is None:
return None
@@ -1027,6 +1046,7 @@ class SLDistro(RHELDistro):
class SuseDistro(Distro):
name = "SUSE"
+ uses_treeinfo = True
_boot_iso_paths = ["boot/boot.iso"]
@@ -1064,8 +1084,11 @@ class SuseDistro(Distro):
self._xen_kernel_paths = [("boot/%s/vmlinuz-xenpae" % self.arch,
"boot/%s/initrd-xenpae" % self.arch)]
else:
- self._xen_kernel_paths = [("boot/%s/vmlinuz-xen" % self.arch,
- "boot/%s/initrd-xen" % self.arch)]
+ self._xen_kernel_paths = [("boot/%s/loader/linux" % self.arch,
+ "boot/%s/loader/initrd" % self.arch)]
+ # By appending this gets searched for first
+ self._xen_kernel_paths.append(("boot/%s/vmlinuz-xen" % self.arch,
+ "boot/%s/initrd-xen" % self.arch))
def _variantFromVersion(self):
distro_version = self.version_from_content[1].strip()
@@ -1077,7 +1100,7 @@ class SuseDistro(Distro):
if len(distro_version.split('.', 1)) == 2:
sp_version = 'sp' + distro_version.split('.', 1)[1].strip()
self.os_variant += version
- if sp_version:
+ if sp_version and sp_version != 'sp0':
self.os_variant += sp_version
elif self.os_variant.startswith("opensuse"):
if len(version) == 8:
@@ -1101,6 +1124,24 @@ class SuseDistro(Distro):
self.os_variant += "9"
def isValidStore(self):
+ if self.treeinfo:
+ ret = False
+ if self.urldistro:
+ family = self.treeinfo.get("general", "family")
+ if "SUSE Linux Enterprise Server" in family and 'sles' in self.urldistro or \
+ "SUSE Linux Enterprise Desktop" in family and 'sled' in self.urldistro or \
+ "SUSE Linux Enterprise" in family and 'sles' in self.urldistro or \
+ "SUSE Containers" in family and 'caasp' in self.urldistro or \
+ "openSUSE" in family and 'opensuse' in self.urldistro or \
+ "Open Enterprise" in family and 'oes' in self.urldistro:
+ ret = True
+ if ret:
+ version = self.treeinfo.get("general", "version")
+ distro_version = ['VERSION', version]
+ self.version_from_content = distro_version
+ self._variantFromVersion()
+ return ret
+
# self.version_from_content is the VERSION line from the contents file
if (not self.version_from_content or
self.version_from_content[1] is None):
@@ -1152,8 +1193,6 @@ class OESDistro(SuseDistro):
urldistro = "oes"
-# Suse image store is harder - we fetch the kernel RPM and a helper
-# RPM and then munge bits together to generate a initrd
class OpensuseDistro(SuseDistro):
urldistro = "opensuse"