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

Pino Toscano ptoscano at redhat.com
Fri Apr 21 11:03:43 UTC 2017


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




More information about the virt-tools-list mailing list