[virt-tools-list] [PATCH] virt-manager: Fix dbus deprecation warning

Marc Deslauriers marc.deslauriers at canonical.com
Sat Feb 11 19:15:10 UTC 2012


Hello,

This patch fixes the following deprecation error message:

/usr/share/virt-manager/virt-manager.py:306: DeprecationWarning:
Importing dbus.glib to use the GLib main loop with dbus-python is deprecated.

Thanks,

Marc.

commit dc90b3538b7d3b4aabb6502d2213e3accea2d035
Author: Marc Deslauriers <marc.deslauriers at ubuntu.com>
Date:   Sat Feb 11 14:11:54 2012 -0500

    Fix dbus deprecation warning

diff --git a/src/virt-manager.py.in b/src/virt-manager.py.in
index 2a82897..7b7acfa 100755
--- a/src/virt-manager.py.in
+++ b/src/virt-manager.py.in
@@ -302,8 +302,9 @@ def main():
     gtk.gdk.threads_init()
 
     import dbus
-    import dbus.glib
-    dbus.glib.threads_init()
+    from dbus.mainloop.glib import DBusGMainLoop
+    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+    dbus.mainloop.glib.threads_init()
     import dbus.service
 
     # Specifically init config/gconf before the fork, so that pam




More information about the virt-tools-list mailing list