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
|
: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']
|
'-o', 'size,data_percent', '--separator', ':', '--nosuffix']
|
||||||
|
|
||||||
# NOTE(gfidente): data_percent only applies to some types of LV so we
|
# 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
|
:returns: List of Dictionaries with PV info
|
||||||
|
|
||||||
"""
|
"""
|
||||||
cmd = ['env', 'LC_ALL=C', 'LANG=C',
|
cmd = ['env', 'LC_ALL=C', 'pvs', '--noheadings',
|
||||||
'pvs', '--noheadings',
|
|
||||||
'--unit=g',
|
'--unit=g',
|
||||||
'-o', 'vg_name,name,size,free',
|
'-o', 'vg_name,name,size,free',
|
||||||
'--separator', ':']
|
'--separator', ':']
|
||||||
|
@ -342,7 +341,7 @@ class LVM(executor.Executor):
|
||||||
:returns: List of Dictionaries with VG info
|
: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', ':']
|
'-o', 'name,size,free,lv_count,uuid', '--separator', ':']
|
||||||
|
|
||||||
if no_suffix:
|
if no_suffix:
|
||||||
|
|
|
@ -54,9 +54,9 @@ CONF.register_opts(image_helper_opt)
|
||||||
|
|
||||||
def qemu_img_info(path):
|
def qemu_img_info(path):
|
||||||
"""Return a object containing the parsed output from qemu-img info."""
|
"""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':
|
if os.name == 'nt':
|
||||||
cmd = cmd[3:]
|
cmd = cmd[2:]
|
||||||
out, err = utils.execute(*cmd, run_as_root=True)
|
out, err = utils.execute(*cmd, run_as_root=True)
|
||||||
return imageutils.QemuImgInfo(out)
|
return imageutils.QemuImgInfo(out)
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ class TestUtils(test.TestCase):
|
||||||
mox.StubOutWithMock(utils, 'execute')
|
mox.StubOutWithMock(utils, 'execute')
|
||||||
|
|
||||||
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_PATH, run_as_root=True).AndReturn(
|
||||||
(TEST_RETURN, 'ignored')
|
(TEST_RETURN, 'ignored')
|
||||||
)
|
)
|
||||||
|
@ -168,8 +168,7 @@ class TestUtils(test.TestCase):
|
||||||
mox = self._mox
|
mox = self._mox
|
||||||
mox.StubOutWithMock(utils, 'execute')
|
mox.StubOutWithMock(utils, 'execute')
|
||||||
|
|
||||||
cmd = ['env', 'LC_ALL=C', 'LANG=C',
|
cmd = ['env', 'LC_ALL=C', 'qemu-img', 'info', TEST_PATH]
|
||||||
'qemu-img', 'info', TEST_PATH]
|
|
||||||
utils.execute(*cmd, run_as_root=True).AndReturn(
|
utils.execute(*cmd, run_as_root=True).AndReturn(
|
||||||
(TEST_RETURN, 'ignored'))
|
(TEST_RETURN, 'ignored'))
|
||||||
|
|
||||||
|
@ -207,8 +206,8 @@ class TestUtils(test.TestCase):
|
||||||
image_utils.create_temporary_file().AndReturn(self.TEST_DEV_PATH)
|
image_utils.create_temporary_file().AndReturn(self.TEST_DEV_PATH)
|
||||||
|
|
||||||
test_qemu_img = utils.execute(
|
test_qemu_img = utils.execute(
|
||||||
'env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info',
|
'env', 'LC_ALL=C', 'qemu-img', 'info', self.TEST_DEV_PATH,
|
||||||
self.TEST_DEV_PATH, run_as_root=True)
|
run_as_root=True)
|
||||||
|
|
||||||
if has_qemu:
|
if has_qemu:
|
||||||
test_qemu_img.AndReturn((TEST_INFO, 'ignored'))
|
test_qemu_img.AndReturn((TEST_INFO, 'ignored'))
|
||||||
|
@ -219,7 +218,7 @@ class TestUtils(test.TestCase):
|
||||||
|
|
||||||
if has_qemu and src_inf:
|
if has_qemu and src_inf:
|
||||||
utils.execute(
|
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(
|
self.TEST_DEV_PATH, run_as_root=True).AndReturn(
|
||||||
(src_inf, 'ignored')
|
(src_inf, 'ignored')
|
||||||
)
|
)
|
||||||
|
@ -230,7 +229,7 @@ class TestUtils(test.TestCase):
|
||||||
self.TEST_DEV_PATH, self.TEST_DEV_PATH, run_as_root=True)
|
self.TEST_DEV_PATH, self.TEST_DEV_PATH, run_as_root=True)
|
||||||
|
|
||||||
utils.execute(
|
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(
|
self.TEST_DEV_PATH, run_as_root=True).AndReturn(
|
||||||
(dest_inf, 'ignored')
|
(dest_inf, 'ignored')
|
||||||
)
|
)
|
||||||
|
@ -334,7 +333,7 @@ class TestUtils(test.TestCase):
|
||||||
self.TEST_IMAGE_ID, self.TEST_DEV_PATH, None, None)
|
self.TEST_IMAGE_ID, self.TEST_DEV_PATH, None, None)
|
||||||
|
|
||||||
utils.execute(
|
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(
|
self.TEST_DEV_PATH, run_as_root=True).AndReturn(
|
||||||
(qemu_info, 'ignored')
|
(qemu_info, 'ignored')
|
||||||
)
|
)
|
||||||
|
@ -396,7 +395,7 @@ class TestUtils(test.TestCase):
|
||||||
utils.execute('qemu-img', 'convert', '-O', 'qcow2',
|
utils.execute('qemu-img', 'convert', '-O', 'qcow2',
|
||||||
mox.IgnoreArg(), mox.IgnoreArg(), run_as_root=True)
|
mox.IgnoreArg(), mox.IgnoreArg(), run_as_root=True)
|
||||||
utils.execute(
|
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(
|
mox.IgnoreArg(), run_as_root=True).AndReturn(
|
||||||
(TEST_RET, 'ignored')
|
(TEST_RET, 'ignored')
|
||||||
)
|
)
|
||||||
|
@ -434,7 +433,7 @@ class TestUtils(test.TestCase):
|
||||||
utils.execute('qemu-img', 'convert', '-O', 'qcow2',
|
utils.execute('qemu-img', 'convert', '-O', 'qcow2',
|
||||||
mox.IgnoreArg(), mox.IgnoreArg(), run_as_root=True)
|
mox.IgnoreArg(), mox.IgnoreArg(), run_as_root=True)
|
||||||
utils.execute(
|
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(
|
mox.IgnoreArg(), run_as_root=True).AndReturn(
|
||||||
(TEST_RET, 'ignored')
|
(TEST_RET, 'ignored')
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue