Browse Source

storage/lvm: minor fix for lvs command building

Do not prepend 'sudo' each time - do a copy of array if that's
necessary.
Marek Marczykowski-Górecki 5 years ago
parent
commit
26a553737f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      qubes/storage/lvm.py

+ 1 - 1
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,