Another fix to suse distro detection in the media.1 parsing
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=368
This commit is contained in:
parent
1c30216228
commit
fa3a5c09cb
@ -10,7 +10,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- virt-manager-1.4.2.orig/virtinst/urlfetcher.py
|
--- virt-manager-1.4.2.orig/virtinst/urlfetcher.py
|
||||||
+++ virt-manager-1.4.2/virtinst/urlfetcher.py
|
+++ virt-manager-1.4.2/virtinst/urlfetcher.py
|
||||||
@@ -392,7 +392,20 @@ def _distroFromSUSEContent(fetcher, arch
|
@@ -392,7 +392,23 @@ def _distroFromSUSEContent(fetcher, arch
|
||||||
try:
|
try:
|
||||||
cbuf = fetcher.acquireFileContent("content")
|
cbuf = fetcher.acquireFileContent("content")
|
||||||
except ValueError:
|
except ValueError:
|
||||||
@ -18,21 +18,24 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
|
|||||||
+ try:
|
+ try:
|
||||||
+ # If no content file, try media.1/products and media.1/build and create
|
+ # 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
|
+ # a cbuf with enough info for the content file parsing code below to work
|
||||||
+ pbuf = fetcher.acquireFileContent("media.1/products").rsplit('/', 1)[1].strip()
|
+ pbuf = fetcher.acquireFileContent("media.1/products").strip()
|
||||||
+ # Older style products format: SUSE-Linux-Enterprise-Server-11-SP4 11.4.4-1.109
|
+ pbuf = pbuf.split(' ', 1)[1].strip()
|
||||||
+ # Newer style products format: SLES12-SP3 12.3-0
|
+ # The media.1/products file naming convention changed between SLE11 and SLE12
|
||||||
+ if pbuf.startswith('SLE') or pbuf.startswith('leanos'):
|
+ if pbuf.startswith('SLE') or pbuf.startswith('leanos'):
|
||||||
+ pbuf = pbuf.split(' ')[0]
|
+ pbuf = pbuf.split(' ')[0]
|
||||||
+ pbuf = " ".join(re.split('(\d+)', pbuf, 1))
|
+ pbuf = " ".join(re.split('(\d+)', pbuf, 1))
|
||||||
+ cbuf = "\nDISTRO ," + pbuf.replace('-', ' ')
|
+ cbuf = "\nDISTRO ," + pbuf.replace('-', ' ')
|
||||||
|
+ try:
|
||||||
+ bbuf = fetcher.acquireFileContent("media.1/build").split('-')
|
+ bbuf = fetcher.acquireFileContent("media.1/build").split('-')
|
||||||
|
+ except:
|
||||||
|
+ bbuf = ["x86_64"]
|
||||||
+ cbuf = cbuf + "\n" + " ".join(bbuf)
|
+ cbuf = cbuf + "\n" + " ".join(bbuf)
|
||||||
+ except ValueError:
|
+ except ValueError:
|
||||||
+ return None
|
+ return None
|
||||||
|
|
||||||
distribution = None
|
distribution = None
|
||||||
distro_version = None
|
distro_version = None
|
||||||
@@ -465,7 +478,8 @@ def _distroFromSUSEContent(fetcher, arch
|
@@ -465,7 +481,8 @@ def _distroFromSUSEContent(fetcher, arch
|
||||||
dclass = GenericDistro
|
dclass = GenericDistro
|
||||||
if distribution:
|
if distribution:
|
||||||
if re.match(".*SUSE Linux Enterprise Server*", distribution[1]) or \
|
if re.match(".*SUSE Linux Enterprise Server*", distribution[1]) or \
|
||||||
@ -42,7 +45,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
|
|||||||
dclass = SLESDistro
|
dclass = SLESDistro
|
||||||
if distro_version is None:
|
if distro_version is None:
|
||||||
distro_version = _parse_sle_distribution(distribution)
|
distro_version = _parse_sle_distribution(distribution)
|
||||||
@@ -481,7 +495,7 @@ def _distroFromSUSEContent(fetcher, arch
|
@@ -481,7 +498,7 @@ def _distroFromSUSEContent(fetcher, arch
|
||||||
dclass = CAASPDistro
|
dclass = CAASPDistro
|
||||||
if distro_version is None:
|
if distro_version is None:
|
||||||
distro_version = ['VERSION', distribution[1].strip().rsplit(' ')[6]]
|
distro_version = ['VERSION', distribution[1].strip().rsplit(' ')[6]]
|
||||||
@ -51,7 +54,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
|
|||||||
dclass = OpensuseDistro
|
dclass = OpensuseDistro
|
||||||
if distro_version is None:
|
if distro_version is None:
|
||||||
distro_version = ['VERSION', distribution[0].strip().rsplit(':')[4]]
|
distro_version = ['VERSION', distribution[0].strip().rsplit(':')[4]]
|
||||||
@@ -1003,6 +1017,7 @@ class SLDistro(RHELDistro):
|
@@ -1003,6 +1020,7 @@ class SLDistro(RHELDistro):
|
||||||
|
|
||||||
class SuseDistro(Distro):
|
class SuseDistro(Distro):
|
||||||
name = "SUSE"
|
name = "SUSE"
|
||||||
@ -59,7 +62,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
|
|||||||
|
|
||||||
_boot_iso_paths = ["boot/boot.iso"]
|
_boot_iso_paths = ["boot/boot.iso"]
|
||||||
|
|
||||||
@@ -1040,8 +1055,11 @@ class SuseDistro(Distro):
|
@@ -1040,8 +1058,11 @@ class SuseDistro(Distro):
|
||||||
self._xen_kernel_paths = [("boot/%s/vmlinuz-xenpae" % self.arch,
|
self._xen_kernel_paths = [("boot/%s/vmlinuz-xenpae" % self.arch,
|
||||||
"boot/%s/initrd-xenpae" % self.arch)]
|
"boot/%s/initrd-xenpae" % self.arch)]
|
||||||
else:
|
else:
|
||||||
@ -73,7 +76,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
|
|||||||
|
|
||||||
def _variantFromVersion(self):
|
def _variantFromVersion(self):
|
||||||
distro_version = self.version_from_content[1].strip()
|
distro_version = self.version_from_content[1].strip()
|
||||||
@@ -1053,7 +1071,7 @@ class SuseDistro(Distro):
|
@@ -1053,7 +1074,7 @@ class SuseDistro(Distro):
|
||||||
if len(distro_version.split('.', 1)) == 2:
|
if len(distro_version.split('.', 1)) == 2:
|
||||||
sp_version = 'sp' + distro_version.split('.', 1)[1].strip()
|
sp_version = 'sp' + distro_version.split('.', 1)[1].strip()
|
||||||
self.os_variant += version
|
self.os_variant += version
|
||||||
@ -82,7 +85,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
|
|||||||
self.os_variant += sp_version
|
self.os_variant += sp_version
|
||||||
elif self.os_variant.startswith("opensuse"):
|
elif self.os_variant.startswith("opensuse"):
|
||||||
if len(version) == 8:
|
if len(version) == 8:
|
||||||
@@ -1077,6 +1095,23 @@ class SuseDistro(Distro):
|
@@ -1077,6 +1098,23 @@ class SuseDistro(Distro):
|
||||||
self.os_variant += "9"
|
self.os_variant += "9"
|
||||||
|
|
||||||
def isValidStore(self):
|
def isValidStore(self):
|
||||||
@ -106,7 +109,7 @@ Index: virt-manager-1.4.2/virtinst/urlfetcher.py
|
|||||||
# self.version_from_content is the VERSION line from the contents file
|
# self.version_from_content is the VERSION line from the contents file
|
||||||
if (not self.version_from_content or
|
if (not self.version_from_content or
|
||||||
self.version_from_content[1] is None):
|
self.version_from_content[1] is None):
|
||||||
@@ -1128,8 +1163,6 @@ class OESDistro(SuseDistro):
|
@@ -1128,8 +1166,6 @@ class OESDistro(SuseDistro):
|
||||||
urldistro = "oes"
|
urldistro = "oes"
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user