storage/lvm: force default locale for lvm command

Scripts do parse its output sometimes (especially `lvs`), so make sure
we always gets the same format, regardless of the environment. Including
decimal separator.

Fixes QubesOS/qubes-issues#3753
This commit is contained in:
Marek Marczykowski-Górecki 2018-03-29 00:53:17 +02:00
parent d6b422cc36
commit faca89875b
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -566,8 +566,10 @@ def qubes_lvm(cmd, log=logging.getLogger('qubes.storage.lvm')):
cmd = ['sudo', 'lvm'] + lvm_cmd
else:
cmd = ['lvm'] + lvm_cmd
environ = os.environ.copy()
environ['LC_ALL'] = 'C.utf8'
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
close_fds=True)
close_fds=True, env=environ)
out, err = p.communicate()
return_code = p.returncode
if out: