Merge "VMware: Add file open mode to support python3"
This commit is contained in:
@@ -2572,6 +2572,7 @@ class VMwareVcVmdkDriverTestCase(test.TestCase):
|
||||
vops.get_entity_name.assert_called_once_with(dc_ref)
|
||||
cookies = session.vim.client.options.transport.cookiejar
|
||||
if use_temp_image:
|
||||
mock_open.assert_called_once_with('/tmp/foo', 'rb')
|
||||
download_file.assert_called_once_with(
|
||||
mock.sentinel.read_handle,
|
||||
self._config.vmware_host_ip,
|
||||
|
||||
@@ -868,7 +868,7 @@ class VMwareVcVmdkDriver(driver.VolumeDriver):
|
||||
tmp_image = tmp_images.get(context, image_id)
|
||||
if tmp_image:
|
||||
LOG.debug("Using temporary image.")
|
||||
with open(tmp_image) as read_handle:
|
||||
with open(tmp_image, 'rb') as read_handle:
|
||||
image_transfer.download_file(read_handle,
|
||||
host_ip,
|
||||
port,
|
||||
|
||||
Reference in New Issue
Block a user