[virt-tools-list] [PATCH 3/4] Use wildcard to detect 'openSUSE Leap'.

Charles Arnold carnold at suse.com
Mon May 7 21:39:37 UTC 2018


Old versions of the string from the content file end with just "openSUSE".
openSUSE 42.x has a string of "openSUSE Leap ". Cleanup extra whitespace
for old versions of openSUSE.

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

---
 virtinst/urldetect.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/virtinst/urldetect.py b/virtinst/urldetect.py
index a1d02577..64fd48a0 100644
--- a/virtinst/urldetect.py
+++ b/virtinst/urldetect.py
@@ -232,9 +232,10 @@ class _SUSEContent(object):
         # Special case, parse version out of a line like this
         # cpe:/o:opensuse:opensuse:13.2,openSUSE
         if (not distro_version and
-            re.match("^.*:.*,openSUSE$", self.content_dict["DISTRO"])):
+            re.match("^.*:.*,openSUSE*", self.content_dict["DISTRO"])):
             distro_version = self.content_dict["DISTRO"].rsplit(
                     ",", 1)[0].strip().rsplit(":")[4]
+        distro_version = distro_version.strip()
 
         if "Enterprise" in self.product_name or "SLES" in self.product_name:
             sle_version = self.product_name.strip().rsplit(' ')[4]
-- 
2.16.3




More information about the virt-tools-list mailing list