]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Brick LVM: Set C locale when gathering PV info
authorEric Harney <eharney@redhat.com>
Thu, 5 Dec 2013 23:12:33 +0000 (18:12 -0500)
committerEric Harney <eharney@redhat.com>
Thu, 5 Dec 2013 23:12:33 +0000 (18:12 -0500)
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

cinder/brick/local_dev/lvm.py

index 872e4fe19122810ecfc1f0d65a951357c6a7ce07..f69b5af6aa28028519fb3acd1d7d8122a6df2baf 100644 (file)
@@ -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', ':']