Remove LANG=C from rootwrap invocations
For more than a decade already, systems support LC_ALL=C, which overwrites LANG=C, so setting both is only confusing. Change-Id: I5640b9cb747892162a856315ea7331cfea7cba5a
This commit is contained in:
parent
1e14e6a42c
commit
32d4f14c9e
|
@ -130,7 +130,7 @@ class LVM(executor.Executor):
|
|||
:returns: Free space, calculated after the data_percent value
|
||||
|
||||
"""
|
||||
cmd = ['env', 'LC_ALL=C', 'LANG=C', 'lvs', '--noheadings', '--unit=g',
|
||||
cmd = ['env', 'LC_ALL=C', 'lvs', '--noheadings', '--unit=g',
|
||||
'-o', 'size,data_percent', '--separator', ':', '--nosuffix']
|
||||
|
||||
# NOTE(gfidente): data_percent only applies to some types of LV so we
|
||||
|
@ -295,8 +295,7 @@ class LVM(executor.Executor):
|
|||
:returns: List of Dictionaries with PV info
|
||||
|
||||
"""
|
||||
cmd = ['env', 'LC_ALL=C', 'LANG=C',
|
||||
'pvs', '--noheadings',
|
||||
cmd = ['env', 'LC_ALL=C', 'pvs', '--noheadings',
|
||||
'--unit=g',
|
||||
'-o', 'vg_name,name,size,free',
|
||||
'--separator', ':']
|
||||
|
@ -342,7 +341,7 @@ class LVM(executor.Executor):
|
|||
:returns: List of Dictionaries with VG info
|
||||
|
||||
"""
|
||||
cmd = ['env', 'LC_ALL=C', 'LANG=C', 'vgs', '--noheadings', '--unit=g',
|
||||
cmd = ['env', 'LC_ALL=C', 'vgs', '--noheadings', '--unit=g',
|
||||
'-o', 'name,size,free,lv_count,uuid', '--separator', ':']
|
||||
|
||||
if no_suffix:
|
||||
|
|
|
@ -54,9 +54,9 @@ CONF.register_opts(image_helper_opt)
|
|||
|
||||
def qemu_img_info(path):
|
||||
"""Return a object containing the parsed output from qemu-img info."""
|
||||
cmd = ('env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info', path)
|
||||
cmd = ('env', 'LC_ALL=C', 'qemu-img', 'info', path)
|
||||
if os.name == 'nt':
|
||||
cmd = cmd[3:]
|
||||
cmd = cmd[2:]
|
||||
out, err = utils.execute(*cmd, run_as_root=True)
|
||||
return imageutils.QemuImgInfo(out)
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ class TestUtils(test.TestCase):
|
|||
mox.StubOutWithMock(utils, 'execute')
|
||||
|
||||
utils.execute(
|
||||
'env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info',
|
||||
'env', 'LC_ALL=C', 'qemu-img', 'info',
|
||||
TEST_PATH, run_as_root=True).AndReturn(
|
||||
(TEST_RETURN, 'ignored')
|
||||
)
|
||||
|
@ -168,8 +168,7 @@ class TestUtils(test.TestCase):
|
|||
mox = self._mox
|
||||
mox.StubOutWithMock(utils, 'execute')
|
||||
|
||||
cmd = ['env', 'LC_ALL=C', 'LANG=C',
|
||||
'qemu-img', 'info', TEST_PATH]
|
||||
cmd = ['env', 'LC_ALL=C', 'qemu-img', 'info', TEST_PATH]
|
||||
utils.execute(*cmd, run_as_root=True).AndReturn(
|
||||
(TEST_RETURN, 'ignored'))
|
||||
|
||||
|
@ -207,8 +206,8 @@ class TestUtils(test.TestCase):
|
|||
image_utils.create_temporary_file().AndReturn(self.TEST_DEV_PATH)
|
||||
|
||||
test_qemu_img = utils.execute(
|
||||
'env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info',
|
||||
self.TEST_DEV_PATH, run_as_root=True)
|
||||
'env', 'LC_ALL=C', 'qemu-img', 'info', self.TEST_DEV_PATH,
|
||||
run_as_root=True)
|
||||
|
||||
if has_qemu:
|
||||
test_qemu_img.AndReturn((TEST_INFO, 'ignored'))
|
||||
|
@ -219,7 +218,7 @@ class TestUtils(test.TestCase):
|
|||
|
||||
if has_qemu and src_inf:
|
||||
utils.execute(
|
||||
'env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info',
|
||||
'env', 'LC_ALL=C', 'qemu-img', 'info',
|
||||
self.TEST_DEV_PATH, run_as_root=True).AndReturn(
|
||||
(src_inf, 'ignored')
|
||||
)
|
||||
|
@ -230,7 +229,7 @@ class TestUtils(test.TestCase):
|
|||
self.TEST_DEV_PATH, self.TEST_DEV_PATH, run_as_root=True)
|
||||
|
||||
utils.execute(
|
||||
'env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info',
|
||||
'env', 'LC_ALL=C', 'qemu-img', 'info',
|
||||
self.TEST_DEV_PATH, run_as_root=True).AndReturn(
|
||||
(dest_inf, 'ignored')
|
||||
)
|
||||
|
@ -334,7 +333,7 @@ class TestUtils(test.TestCase):
|
|||
self.TEST_IMAGE_ID, self.TEST_DEV_PATH, None, None)
|
||||
|
||||
utils.execute(
|
||||
'env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info',
|
||||
'env', 'LC_ALL=C', 'qemu-img', 'info',
|
||||
self.TEST_DEV_PATH, run_as_root=True).AndReturn(
|
||||
(qemu_info, 'ignored')
|
||||
)
|
||||
|
@ -396,7 +395,7 @@ class TestUtils(test.TestCase):
|
|||
utils.execute('qemu-img', 'convert', '-O', 'qcow2',
|
||||
mox.IgnoreArg(), mox.IgnoreArg(), run_as_root=True)
|
||||
utils.execute(
|
||||
'env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info',
|
||||
'env', 'LC_ALL=C', 'qemu-img', 'info',
|
||||
mox.IgnoreArg(), run_as_root=True).AndReturn(
|
||||
(TEST_RET, 'ignored')
|
||||
)
|
||||
|
@ -434,7 +433,7 @@ class TestUtils(test.TestCase):
|
|||
utils.execute('qemu-img', 'convert', '-O', 'qcow2',
|
||||
mox.IgnoreArg(), mox.IgnoreArg(), run_as_root=True)
|
||||
utils.execute(
|
||||
'env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info',
|
||||
'env', 'LC_ALL=C', 'qemu-img', 'info',
|
||||
mox.IgnoreArg(), run_as_root=True).AndReturn(
|
||||
(TEST_RET, 'ignored')
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue