[virt-tools-list] [virt-manager RFC PATCH v2 5/7] tests: fix to not fail with libosinfo

Giuseppe Scrivano gscrivan at redhat.com
Fri Jan 24 14:13:21 UTC 2014


Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
---
 tests/misc.py          | 3 +--
 virtinst/osdict.py     | 2 +-
 virtinst/urlfetcher.py | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tests/misc.py b/tests/misc.py
index c164d25..243d778 100644
--- a/tests/misc.py
+++ b/tests/misc.py
@@ -22,8 +22,7 @@ import os
 import sys
 import unittest
 
-_badmodules = ["gi.repository.Gtk", "gi.repository.GObject",
-              "gi.repository.Gdk", "gi.repository.GLib"]
+_badmodules = ["gi.repository.Gtk", "gi.repository.Gdk"]
 
 
 def _restore_modules(fn):
diff --git a/virtinst/osdict.py b/virtinst/osdict.py
index 5ad4325..f92a856 100644
--- a/virtinst/osdict.py
+++ b/virtinst/osdict.py
@@ -22,7 +22,7 @@
 _SENTINEL = -1234
 _allvariants = {}
 from datetime import datetime
-from gi.repository import Libosinfo as libosinfo
+from gi.repository import Libosinfo as libosinfo  # pylint: disable=E0611
 
 
 _aliases = {
diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
index 438c0f5..07d6827 100644
--- a/virtinst/urlfetcher.py
+++ b/virtinst/urlfetcher.py
@@ -642,7 +642,7 @@ class FedoraDistro(RedHatDistro):
         """
         ret = None
         for osinfo in osdict.list_os(typename="linux"):
-            if osinfo.name.startswith("fedora"):
+            if osinfo.name.startswith("fedora") and "unknown" not in osinfo.name:
                 # First fedora* occurence should be the newest
                 ret = osinfo.name
                 break
-- 
1.8.4.2




More information about the virt-tools-list mailing list