From 26a553737f62a5714fa66a5992bd0ede0ee4fe29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 29 Oct 2018 05:16:23 +0100 Subject: [PATCH] storage/lvm: minor fix for lvs command building Do not prepend 'sudo' each time - do a copy of array if that's necessary. --- qubes/storage/lvm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qubes/storage/lvm.py b/qubes/storage/lvm.py index 8943bb06..47324621 100644 --- a/qubes/storage/lvm.py +++ b/qubes/storage/lvm.py @@ -219,7 +219,7 @@ def _parse_lvm_cache(lvm_output): def init_cache(log=logging.getLogger('qubes.storage.lvm')): cmd = _init_cache_cmd if os.getuid() != 0: - cmd.insert(0, 'sudo') + cmd = ['sudo'] + cmd environ = os.environ.copy() environ['LC_ALL'] = 'C.utf8' p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,