[virt-manager PATCH v2 3/3] osdict: adapt latest_regex() to ignore "-unknown" distros

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

 



There may be case where enterprise distros decide to adopt the "unknown"
approach in osinfo-db and there we'll be able to see different versions
of "unknown" and in order to avoid those to be shown to the user, let's
just ignore them when matching the regex.

This approach seems less error prone then trying to do that in the regex
itself and that's the reason it's been taken.

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

diff --git a/virtinst/osdict.py b/virtinst/osdict.py
index ec9aa430..98104553 100644
--- a/virtinst/osdict.py
+++ b/virtinst/osdict.py
@@ -235,7 +235,7 @@ class _OSDB(object):
         """
         Return the latest distro name that matches the passed regex
         """
-        oses = [o.name for o in self.list_os() if re.match(regex, o.name)]
+        oses = [o.name for o in self.list_os() if re.match(regex, o.name) and not o.name.endswith("-unknown")]
         if not oses:
             return None
 
-- 
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