storage/lvm: minor fix for lvs command building
Do not prepend 'sudo' each time - do a copy of array if that's necessary.
This commit is contained in:
parent
42061cb194
commit
26a553737f
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user