The while loop that follows is similar to rhel code but because the osinfo-db short id for sles doesn't contain a '.0' for first time releases (eg, sles11, sles12) we check sle with no update and don't add a '.0' to the string. Signed-off-by: Charles Arnold <carnold@xxxxxxxx> --- virtinst/urldetect.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/virtinst/urldetect.py b/virtinst/urldetect.py index 7140dae5..a1d02577 100644 --- a/virtinst/urldetect.py +++ b/virtinst/urldetect.py @@ -614,6 +614,19 @@ class SuseDistro(Distro): if re.search("openSUSE Tumbleweed", self.cache.treeinfo_name): return "opensusetumbleweed" + version, update = self.cache.split_version() + self._version_number = version + + base = self._variant_prefix + str(version) + while update >= 0: + tryvar = base + # SLE doesn't use '.0' for initial releases in osinfo-db (sles11, sles12, etc) + if update > 0 or not base.startswith('sle'): + tryvar += ".%s" % update + if OSDB.lookup_os(tryvar): + return tryvar + update -= 1 + def _detect_version(self): var = self._detect_from_treeinfo() if not var: -- 2.16.3 _______________________________________________ virt-tools-list mailing list virt-tools-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/virt-tools-list