From e9f1bb38805b9c7a397180d75cd1862256a7be52 Mon Sep 17 00:00:00 2001 From: Wojciech Zygmunt Porczyk Date: Thu, 22 May 2014 15:07:35 +0200 Subject: [PATCH] *.py: Use full paths when calling subprocess.Popen(). Also removed unneeded imports of subprocess. --- qubesmanager/appmenu_select.py | 1 - qubesmanager/backup.py | 1 - qubesmanager/backup_utils.py | 4 ++-- qubesmanager/global_settings.py | 1 - qubesmanager/main.py | 4 ++-- qubesmanager/restore.py | 1 - 6 files changed, 4 insertions(+), 8 deletions(-) diff --git a/qubesmanager/appmenu_select.py b/qubesmanager/appmenu_select.py index b90eb92..75dc71d 100755 --- a/qubesmanager/appmenu_select.py +++ b/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 diff --git a/qubesmanager/backup.py b/qubesmanager/backup.py index 3c41e34..da7d84f 100644 --- a/qubesmanager/backup.py +++ b/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 diff --git a/qubesmanager/backup_utils.py b/qubesmanager/backup_utils.py index d595e6a..534e2f0 100644 --- a/qubesmanager/backup_utils.py +++ b/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: diff --git a/qubesmanager/global_settings.py b/qubesmanager/global_settings.py index 0302ac9..fe48d6a 100644 --- a/qubesmanager/global_settings.py +++ b/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 diff --git a/qubesmanager/main.py b/qubesmanager/main.py index be2e810..e5cff64 100755 --- a/qubesmanager/main.py +++ b/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() diff --git a/qubesmanager/restore.py b/qubesmanager/restore.py index a34cf5c..a9e00c9 100644 --- a/qubesmanager/restore.py +++ b/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 *