virt-manager/virtinst-add-casp-support.patch

49 lines
2.0 KiB
Diff
Raw Normal View History

References: bsc#1010060
Notes: SUSE Containers as a Service Platform and 'CASP' are not
names set in stone yet and could change before the product ships.
Index: virt-manager-1.4.0/virtinst/urlfetcher.py
===================================================================
--- virt-manager-1.4.0.orig/virtinst/urlfetcher.py
+++ virt-manager-1.4.0/virtinst/urlfetcher.py
@@ -464,6 +464,10 @@ def _distroFromSUSEContent(fetcher, arch
dclass = SLESDistro
if distro_version is None:
distro_version = ['VERSION', distribution[1].strip().rsplit(' ')[4]]
+ elif re.match(".*SUSE Containers as a Service Platform*", distribution[1]):
+ dclass = CASPDistro
+ if distro_version is None:
+ distro_version = ['VERSION', distribution[1].strip().rsplit(' ')[6]]
elif re.match(".*openSUSE.*", distribution[1]):
dclass = OpensuseDistro
if distro_version is None:
@@ -1019,7 +1023,8 @@ class SuseDistro(Distro):
distro_version = self.version_from_content[1].strip()
version = distro_version.split('.', 1)[0].strip()
self.os_variant = self.urldistro
- if int(version) >= 10:
+ version_int = int(version)
+ if version_int >= 10:
if self.os_variant.startswith(("sles", "sled")):
sp_version = None
if len(distro_version.split('.', 1)) == 2:
@@ -1033,6 +1038,8 @@ class SuseDistro(Distro):
self.os_variant += "tumbleweed"
else:
self.os_variant += distro_version
+ elif version_int == 1 and self.os_variant.startswith("casp"):
+ self.os_variant = "casp"
else:
self.os_variant += "9"
@@ -1079,6 +1086,9 @@ class SLESDistro(SuseDistro):
class SLEDDistro(SuseDistro):
urldistro = "sled"
+class CASPDistro(SuseDistro):
+ urldistro = "casp"
+
# Suse image store is harder - we fetch the kernel RPM and a helper
# RPM and then munge bits together to generate a initrd