Merge "Remove utils.execute() calls from xenapi."
This commit is contained in:
commit
4a688c3387
|
@ -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')
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue