Merge "Fix the way qemu-img is called with prlimits"

This commit is contained in:
Zuul
2025年03月05日 12:31:50 +00:00
committed by Gerrit Code Review

View File

@@ -89,7 +89,7 @@ def image_info(path, source_format=None):
if 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')

View File

@@ -44,8 +44,8 @@ class ImageInfoTestCase(base.IronicAgentTest):
qemu_img.image_info('img')
path_exists_mock.assert_called_once_with('img')
execute_mock.assert_called_once_with(
['env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info', 'img',
'--output=json'], prlimit=mock.ANY)
'env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info', 'img',
'--output=json', prlimit=mock.ANY)
image_info_mock.assert_called_once_with('out', format='json')
@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')
path_exists_mock.assert_called_once_with('img')
execute_mock.assert_called_once_with(
['env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info', 'img',
'--output=json', '-f', 'qcow2'],
'env', 'LC_ALL=C', 'LANG=C', 'qemu-img', 'info', 'img',
'--output=json', '-f', 'qcow2',
prlimit=mock.ANY
)
image_info_mock.assert_called_once_with('out', format='json')
Reference in New Issue
openstack/ironic-python-agent
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.