Browse Source

*.py: Use full paths when calling subprocess.Popen().

Also removed unneeded imports of subprocess.
Wojciech Zygmunt Porczyk 10 years ago
parent
commit
e9f1bb3880

+ 0 - 1
qubesmanager/appmenu_select.py

@@ -34,7 +34,6 @@ import qubesmanager.resources_rc
 
 from pyinotify import WatchManager, Notifier, ThreadedNotifier, EventsCodes, ProcessEvent
 
-import subprocess
 import time
 
 from operator import itemgetter

+ 0 - 1
qubesmanager/backup.py

@@ -39,7 +39,6 @@ import qubesmanager.resources_rc
 
 from pyinotify import WatchManager, Notifier, ThreadedNotifier, EventsCodes, ProcessEvent
 
-import subprocess
 import time
 from thread_monitor import *
 from operator import itemgetter

+ 2 - 2
qubesmanager/backup_utils.py

@@ -62,7 +62,7 @@ def mount_device(dev_path):
 def umount_device(dev_mount_path):
     while True:
         try:
-            pumount_cmd = ["sudo", "pumount", "--luks-force", dev_mount_path]
+            pumount_cmd = ["/usr/bin/sudo", "/usr/bin/pumount", "--luks-force", dev_mount_path]
             res = subprocess.check_call(pumount_cmd)
             if res == 0:
                 dev_mount_path = None
@@ -85,7 +85,7 @@ def detach_device(dialog, dev_name):
     else:
         # umount/LUKS remove do not trigger udev event on underlying device,
         # so trigger it manually - to publish back as available device
-        subprocess.call(["sudo", "udevadm", "trigger", "--action=change",
+        subprocess.call(["/usr/bin/sudo", "/bin/udevadm", "trigger", "--action=change",
                                  "--subsystem-match=block",
                                  "--sysname-match=%s" % dev_name.split(":")[1]])
         with dialog.blk_manager.blk_lock:

+ 0 - 1
qubesmanager/global_settings.py

@@ -36,7 +36,6 @@ import qubesmanager.resources_rc
 
 from pyinotify import WatchManager, Notifier, ThreadedNotifier, EventsCodes, ProcessEvent
 
-import subprocess
 import time
 import threading
 from operator import itemgetter

+ 2 - 2
qubesmanager/main.py

@@ -1741,7 +1741,7 @@ class QubesDbusNotifyServerAdaptor(QDBusAbstractAdaptor):
 def get_frame_size():
     w = 0
     h = 0
-    cmd = ['xprop', '-name', 'Qubes VM Manager', '|', 'grep', '_NET_FRAME_EXTENTS']
+    cmd = ['/usr/bin/xprop', '-name', 'Qubes VM Manager', '|', 'grep', '_NET_FRAME_EXTENTS']
     xprop = subprocess.Popen(cmd, stdout = subprocess.PIPE)
     for l in xprop.stdout:
         line = l.split('=')
@@ -1775,7 +1775,7 @@ def show_manager():
 def bring_manager_to_front():
 
     if manager_window.isVisible():
-        subprocess.check_call(['wmctrl', '-R', str(manager_window.windowTitle())])
+        subprocess.check_call(['/usr/bin/wmctrl', '-R', str(manager_window.windowTitle())])
 
     else:
         show_manager()

+ 0 - 1
qubesmanager/restore.py

@@ -37,7 +37,6 @@ import signal
 
 from pyinotify import WatchManager, Notifier, ThreadedNotifier, EventsCodes, ProcessEvent
 
-import subprocess
 import time
 from operator import itemgetter
 from thread_monitor import *