2017-08-25 00:03:36 +02:00
|
|
|
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 media.1/products file for distro version and the
|
|
|
|
media.1/build file for the arch. The media.1/products and media.1/build files
|
|
|
|
have always been around so the entire _distroFromSUSEContent could be rewritten
|
|
|
|
(and simplified) to only check them. The products file format did change
|
|
|
|
between 11-SP4 and 12. SLE10 has no build file.
|
|
|
|
|
|
|
|
Index: virt-manager-1.4.2/virtinst/urlfetcher.py
|
|
|
|
===================================================================
|
|
|
|
--- virt-manager-1.4.2.orig/virtinst/urlfetcher.py
|
|
|
|
+++ virt-manager-1.4.2/virtinst/urlfetcher.py
|
|
|
|
@@ -392,7 +392,20 @@ 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").rsplit('/', 1)[1].strip()
|
|
|
|
+ # Older style products format: SUSE-Linux-Enterprise-Server-11-SP4 11.4.4-1.109
|
|
|
|
+ # Newer style products format: SLES12-SP3 12.3-0
|
2017-09-12 00:24:03 +02:00
|
|
|
+ if pbuf.startswith('SLE') or pbuf.startswith('leanos'):
|
2017-08-25 00:03:36 +02:00
|
|
|
+ pbuf = pbuf.split(' ')[0]
|
|
|
|
+ pbuf = " ".join(re.split('(\d+)', pbuf, 1))
|
|
|
|
+ cbuf = "\nDISTRO ," + pbuf.replace('-', ' ')
|
|
|
|
+ bbuf = fetcher.acquireFileContent("media.1/build").split('-')
|
|
|
|
+ cbuf = cbuf + "\n" + " ".join(bbuf)
|
|
|
|
+ except ValueError:
|
|
|
|
+ return None
|
|
|
|
|
|
|
|
distribution = None
|
|
|
|
distro_version = None
|
2017-09-12 00:24:03 +02:00
|
|
|
@@ -465,7 +478,8 @@ def _distroFromSUSEContent(fetcher, arch
|
2017-08-25 00:03:36 +02:00
|
|
|
dclass = GenericDistro
|
|
|
|
if distribution:
|
|
|
|
if re.match(".*SUSE Linux Enterprise Server*", distribution[1]) or \
|
|
|
|
- re.match(".*SUSE SLES*", distribution[1]):
|
2017-09-12 00:24:03 +02:00
|
|
|
+ re.match(".*SUSE SLES*", distribution[1]) or re.match("SLES*", distribution[1]) or \
|
|
|
|
+ re.match("leanos*", distribution[1]):
|
2017-08-25 00:03:36 +02:00
|
|
|
dclass = SLESDistro
|
|
|
|
if distro_version is None:
|
|
|
|
distro_version = _parse_sle_distribution(distribution)
|
2017-09-12 00:24:03 +02:00
|
|
|
@@ -481,7 +495,7 @@ def _distroFromSUSEContent(fetcher, arch
|
2017-08-25 00:03:36 +02:00
|
|
|
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]]
|
2017-09-12 00:24:03 +02:00
|
|
|
@@ -1040,8 +1054,11 @@ class SuseDistro(Distro):
|
2017-08-25 23:12:42 +02:00
|
|
|
self._xen_kernel_paths = [("boot/%s/vmlinuz-xenpae" % self.arch,
|
|
|
|
"boot/%s/initrd-xenpae" % self.arch)]
|
2017-08-25 00:03:36 +02:00
|
|
|
else:
|
2017-08-25 23:12:42 +02:00
|
|
|
- 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))
|
2017-08-25 00:03:36 +02:00
|
|
|
|
|
|
|
def _variantFromVersion(self):
|
|
|
|
distro_version = self.version_from_content[1].strip()
|