diff --git a/nova/tests/unit/virt/xenapi/test_vm_utils.py b/nova/tests/unit/virt/xenapi/test_vm_utils.py index 435d6da514af..ef2d687e8f82 100644 --- a/nova/tests/unit/virt/xenapi/test_vm_utils.py +++ b/nova/tests/unit/virt/xenapi/test_vm_utils.py @@ -138,7 +138,7 @@ class GenerateConfigDriveTestCase(VMUtilsTestBase): @mock.patch.object(vm_utils, "create_vdi", return_value='vdi_ref') @mock.patch.object(vm_utils.instance_metadata, "InstanceMetadata") @mock.patch.object(vm_utils.configdrive, 'ConfigDriveBuilder') - @mock.patch.object(vm_utils.utils, 'execute') + @mock.patch('oslo_concurrency.processutils.execute') @mock.patch.object(vm_utils.volume_utils, 'stream_to_vdi') @mock.patch.object(vm_utils.os.path, 'getsize', return_value=100) @mock.patch.object(vm_utils, 'create_vbd', return_value='vbd_ref') diff --git a/nova/virt/xenapi/agent.py b/nova/virt/xenapi/agent.py index 6abfbe168287..d5f060af5d43 100644 --- a/nova/virt/xenapi/agent.py +++ b/nova/virt/xenapi/agent.py @@ -21,6 +21,7 @@ import time from os_xenapi.client import host_agent from os_xenapi.client import XenAPI +from oslo_concurrency import processutils from oslo_log import log as logging from oslo_serialization import base64 from oslo_serialization import jsonutils @@ -421,8 +422,8 @@ class SimpleDH(object): 'pass:%s' % self._shared, '-nosalt'] if decrypt: cmd.append('-d') - out, err = utils.execute(*cmd, - process_input=encodeutils.safe_encode(text)) + out, err = processutils.execute( + *cmd, process_input=encodeutils.safe_encode(text)) if err: raise RuntimeError(_('OpenSSL error: %s') % err) return out diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py index 0dadb95287ff..b5394f0e83b6 100644 --- a/nova/virt/xenapi/vm_utils.py +++ b/nova/virt/xenapi/vm_utils.py @@ -1155,8 +1155,8 @@ def generate_configdrive(session, context, instance, vm_ref, userdevice, # XAPI can only import a VHD file, so convert to vhd format vhd_file = '%s.vhd' % tmp_file with compute_utils.disk_ops_semaphore: - utils.execute('qemu-img', 'convert', '-Ovpc', tmp_file, - vhd_file) + processutils.execute('qemu-img', 'convert', '-Ovpc', + tmp_file, vhd_file) vhd_file_size = os.path.getsize(vhd_file) with open(vhd_file) as file_obj: volume_utils.stream_to_vdi(