Merge "Remove utils.execute() from the hyperv driver."

This commit is contained in:
Zuul 2018-12-17 21:06:56 +00:00 committed by Gerrit Code Review
commit 0b9f634de2
2 changed files with 10 additions and 10 deletions

View File

@ -935,7 +935,7 @@ class VMOpsTestCase(test_base.HyperVBaseTestCase):
@mock.patch('nova.api.metadata.base.InstanceMetadata')
@mock.patch('nova.virt.configdrive.ConfigDriveBuilder')
@mock.patch('nova.utils.execute')
@mock.patch('oslo_concurrency.processutils.execute')
def _test_create_config_drive(self, mock_execute, mock_ConfigDriveBuilder,
mock_InstanceMetadata, config_drive_format,
config_drive_cdrom, side_effect,

View File

@ -677,15 +677,15 @@ class VMOps(object):
if not CONF.hyperv.config_drive_cdrom:
configdrive_path = self._pathutils.get_configdrive_path(
instance.name, constants.DISK_FORMAT_VHD, rescue=rescue)
utils.execute(CONF.hyperv.qemu_img_cmd,
'convert',
'-f',
'raw',
'-O',
'vpc',
configdrive_path_iso,
configdrive_path,
attempts=1)
processutils.execute(CONF.hyperv.qemu_img_cmd,
'convert',
'-f',
'raw',
'-O',
'vpc',
configdrive_path_iso,
configdrive_path,
attempts=1)
self._pathutils.remove(configdrive_path_iso)
else:
configdrive_path = configdrive_path_iso