[virt-tools-list] [PATCH 4/5] virt-manager: fix "Copy Volume Path" in storage pool details window

Giuseppe Scrivano gscrivan at redhat.com
Tue Aug 13 12:26:28 UTC 2013


It fixes this error:

Traceback (most recent call last):
  File "virt-manager/virtManager/host.py", line 973, in copy_vol_path
    clipboard.set_text(target_path)
  File "/usr/lib/python2.7/site-packages/gi/types.py", line 113, in function
    return info.invoke(*args, **kwargs)
TypeError: set_text() takes exactly 3 arguments (2 given)

Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
---
 virtManager/host.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/virtManager/host.py b/virtManager/host.py
index e83865a..2da521b 100644
--- a/virtManager/host.py
+++ b/virtManager/host.py
@@ -23,6 +23,7 @@ import logging
 # pylint: disable=E0611
 from gi.repository import GObject
 from gi.repository import Gtk
+from gi.repository import Gdk
 # pylint: enable=E0611
 
 from virtinst import VirtualDisk
@@ -967,10 +968,10 @@ class vmmHost(vmmGObjectUI):
         vol = self.current_vol()
         if not vol:
             return
-        clipboard = Gtk.Clipboard()
+        clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
         target_path = vol.get_target_path()
         if target_path:
-            clipboard.set_text(target_path)
+            clipboard.set_text(target_path, -1)
 
 
     def repopulate_storage_pools(self, src_ignore=None, uuid_ignore=None):
-- 
1.8.3.1




More information about the virt-tools-list mailing list