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

Also removed unneeded imports of subprocess.
This commit is contained in:
Wojciech Zygmunt Porczyk 2014-05-22 15:07:35 +02:00
parent fe954632c0
commit e9f1bb3880
6 changed files with 4 additions and 8 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -1741,7 +1741,7 @@ class QubesDbusNotifyServerAdaptor(QDBusAbstractAdaptor):
def get_frame_size(): def get_frame_size():
w = 0 w = 0
h = 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) xprop = subprocess.Popen(cmd, stdout = subprocess.PIPE)
for l in xprop.stdout: for l in xprop.stdout:
line = l.split('=') line = l.split('=')
@ -1775,7 +1775,7 @@ def show_manager():
def bring_manager_to_front(): def bring_manager_to_front():
if manager_window.isVisible(): 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: else:
show_manager() show_manager()

View File

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