Skip to content

Commit

Permalink
storage/lvm: minor fix for lvs command building
Browse files Browse the repository at this point in the history
Do not prepend 'sudo' each time - do a copy of array if that's
necessary.
  • Loading branch information
marmarek committed Oct 29, 2018
1 parent 42061cb commit 26a5537
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qubes/storage/lvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 26a5537

Please sign in to comment.