From: Eric Harney Date: Thu, 5 Dec 2013 23:12:33 +0000 (-0500) Subject: Brick LVM: Set C locale when gathering PV info X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=174ebde8e6a8cddc2db615b127d7d0066dabaa31;p=openstack-build%2Fcinder-build.git Brick LVM: Set C locale when gathering PV info Some locales use commas as decimal separators, which means that code breaks when someone expects to be able to use the PV size as a float. Change-Id: Idceb405e021ea8a0f44e19be43bad1307fbbb51c Related-Bug: 1219963 --- diff --git a/cinder/brick/local_dev/lvm.py b/cinder/brick/local_dev/lvm.py index 872e4fe19..f69b5af6a 100644 --- a/cinder/brick/local_dev/lvm.py +++ b/cinder/brick/local_dev/lvm.py @@ -259,7 +259,8 @@ class LVM(executor.Executor): :returns: List of Dictionaries with PV info """ - cmd = ['pvs', '--noheadings', + cmd = ['env', 'LC_ALL=C', 'LANG=C', + 'pvs', '--noheadings', '--unit=g', '-o', 'vg_name,name,size,free', '--separator', ':']