[virt-manager PATCH 1/4] osdict: expose the distro from OsVariant

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

 



This is used already internally a couple of times, and will be useful
outside as well.
---
 virtinst/osdict.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/virtinst/osdict.py b/virtinst/osdict.py
index c0c5a06..403aaaf 100644
--- a/virtinst/osdict.py
+++ b/virtinst/osdict.py
@@ -288,6 +288,7 @@ class _OsVariant(object):
         self.name = self._os and self._os.get_short_id() or "generic"
         self.label = self._os and self._os.get_name() or "Generic"
         self.codename = self._os and self._os.get_codename() or ""
+        self.distro = self._os and self._os.get_distro() or ""
 
         self.sortby = self._get_sortby()
         self.urldistro = self._get_urldistro()
@@ -353,8 +354,7 @@ class _OsVariant(object):
         except:
             pass
 
-        distro = self._os.get_distro()
-        return "%s-%s" % (distro, version)
+        return "%s-%s" % (self.distro, version)
 
     def _get_supported(self):
         if not self._os:
@@ -382,7 +382,7 @@ class _OsVariant(object):
     def _get_urldistro(self):
         if not self._os:
             return None
-        urldistro = self._os.get_distro()
+        urldistro = self.distro
         remap = {
             "opensuse" : "suse",
             "sles" : "suse",
-- 
2.9.3

_______________________________________________
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