[virt-manager PATCH v2 2/3] osdict: adapt latest_regex() to openSUSE's versioning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Due to OpenSUSE's decision of versioning their OS as 11.x, 12.x, 42.x,
15.x, we have to add a specific check in latest_regex() in order to make
sure we skip the 42.x series in the sorted list of OSes when returning
the OS name to the user.

Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
---
 virtinst/osdict.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/virtinst/osdict.py b/virtinst/osdict.py
index 49085e6d..ec9aa430 100644
--- a/virtinst/osdict.py
+++ b/virtinst/osdict.py
@@ -238,6 +238,15 @@ class _OSDB(object):
         oses = [o.name for o in self.list_os() if re.match(regex, o.name)]
         if not oses:
             return None
+
+        # OpenSUSE's decision of having their versioning as 11.x, 12.x, 42.x,
+        # 15.x forces us to have this specific check for then.
+        # Knowing that 42 series was composed of 42.[1-3] and that the series
+        # will not have any more release, we can safely return the 4th element
+        # of the oses
+        if regex.startswith("opensuse"):
+            return oses[3]
+
         return oses[0]
 
     def latest_os_version(self, osdistro):
-- 
2.19.1

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux