Merge "Fix the way qemu-img is called with prlimits"
This commit is contained in:
@@ -89,7 +89,7 @@ def image_info(path, source_format=None):
|
|||||||
if source_format:
|
if source_format:
|
||||||
cmd += ['-f', source_format]
|
cmd += ['-f', source_format]
|
||||||
|
|
||||||
out, err = utils.execute(cmd, prlimit=_qemu_img_limits())
|
out, err = utils.execute(*cmd, prlimit=_qemu_img_limits())
|
||||||
return imageutils.QemuImgInfo(out, format='json')
|
return imageutils.QemuImgInfo(out, format='json')
|
||||||
|
|
||||||
|
|
||||||
|
@@ -44,8 +44,8 @@ class ImageInfoTestCase(base.IronicAgentTest):
|
|||||||
qemu_img.image_info('img')
|
qemu_img.image_info('img')
|
||||||
path_exists_mock.assert_called_once_with('img')
|
path_exists_mock.assert_called_once_with('img')
|
||||||
execute_mock.assert_called_once_with(
|
execute_mock.assert_called_once_with(
|
||||||
['env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info', 'img',
|
'env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info', 'img',
|
||||||
'--output=json'], prlimit=mock.ANY)
|
'--output=json', prlimit=mock.ANY)
|
||||||
image_info_mock.assert_called_once_with('out', format='json')
|
image_info_mock.assert_called_once_with('out', format='json')
|
||||||
|
|
||||||
@mock.patch.object(utils, 'execute', return_value=('out', 'err'),
|
@mock.patch.object(utils, 'execute', return_value=('out', 'err'),
|
||||||
@@ -57,8 +57,8 @@ class ImageInfoTestCase(base.IronicAgentTest):
|
|||||||
qemu_img.image_info('img', source_format='qcow2')
|
qemu_img.image_info('img', source_format='qcow2')
|
||||||
path_exists_mock.assert_called_once_with('img')
|
path_exists_mock.assert_called_once_with('img')
|
||||||
execute_mock.assert_called_once_with(
|
execute_mock.assert_called_once_with(
|
||||||
['env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info', 'img',
|
'env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info', 'img',
|
||||||
'--output=json', '-f', 'qcow2'],
|
'--output=json', '-f', 'qcow2',
|
||||||
prlimit=mock.ANY
|
prlimit=mock.ANY
|
||||||
)
|
)
|
||||||
image_info_mock.assert_called_once_with('out', format='json')
|
image_info_mock.assert_called_once_with('out', format='json')
|
||||||
|
Reference in New Issue
Block a user