[virt-manager PATCH] Make SpiceClientGtk optional

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

 



It's not available on all architectures. This allows us to turn
the hard dependency into a soft on.
---
 virtManager/console.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/virtManager/console.py b/virtManager/console.py
index 67bfe10..54e476f 100644
--- a/virtManager/console.py
+++ b/virtManager/console.py
@@ -24,8 +24,12 @@ from gi.repository import GObject
 from gi.repository import Gtk
 from gi.repository import Gdk
 from gi.repository import GtkVnc
-from gi.repository import SpiceClientGtk
-from gi.repository import SpiceClientGLib
+try:
+    from gi.repository import SpiceClientGtk
+    from gi.repository import SpiceClientGLib
+    have_spice_gtk = True
+except ImportError:
+    have_spice_gtk = False
 
 import libvirt
 
@@ -1253,7 +1257,10 @@ class vmmConsolePages(vmmGObjectUI):
             if ginfo.gtype == "vnc":
                 self.viewer = VNCViewer(self)
             elif ginfo.gtype == "spice":
-                self.viewer = SpiceViewer(self)
+                if have_spice_gtk:
+                    self.viewer = SpiceViewer(self)
+                else:
+                    raise RuntimeError("Error opening Spice console, SpiceClientGtk missing")
 
             self.set_enable_accel()
 
-- 
2.1.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