Use wildcard to detect 'openSUSE Leap'.

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@suse.com>
This commit is contained in:
Charles Arnold 2018-05-07 15:39:37 -06:00 committed by Cole Robinson
parent e6fd723c46
commit 26b8bb0f0b
1 changed files with 2 additions and 1 deletions

View File

@ -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]