diff --git a/nova/tests/unit/virt/vmwareapi/test_vmops.py b/nova/tests/unit/virt/vmwareapi/test_vmops.py index f1d2c83d4c3d..b3fee86f2f60 100644 --- a/nova/tests/unit/virt/vmwareapi/test_vmops.py +++ b/nova/tests/unit/virt/vmwareapi/test_vmops.py @@ -967,6 +967,12 @@ class VMwareVMOpsTestCase(test.NoDBTestCase): self.flags(flat_injected=False) self.flags(enabled=False, group='vnc') + mock_vi = mock.Mock() + mock_vi.root_gb = 1 + mock_vi.ii.file_size = 2 * units.Gi + mock_vi.instance.flavor.root_gb = 1 + mock_get_vm_config_info.return_value = mock_vi + # Call spawn(). We don't care what it does as long as it generates # the log message, which we check below. with mock.patch.object(self._vmops, '_volumeops') as mock_vo: diff --git a/nova/virt/vmwareapi/images.py b/nova/virt/vmwareapi/images.py index 9cd4794c891f..99beeaab8923 100644 --- a/nova/virt/vmwareapi/images.py +++ b/nova/virt/vmwareapi/images.py @@ -24,6 +24,7 @@ from lxml import etree from oslo_config import cfg from oslo_log import log as logging from oslo_service import loopingcall +from oslo_utils import encodeutils from oslo_utils import strutils from oslo_utils import units from oslo_vmware import rw_handles @@ -368,7 +369,7 @@ def fetch_image_stream_optimized(context, instance, session, vm_name, def get_vmdk_name_from_ovf(xmlstr): """Parse the OVA descriptor to extract the vmdk name.""" - ovf = etree.fromstring(xmlstr) + ovf = etree.fromstring(encodeutils.safe_encode(xmlstr)) nsovf = "{%s}" % ovf.nsmap["ovf"] disk = ovf.find("./%sDiskSection/%sDisk" % (nsovf, nsovf)) diff --git a/tests-py3.txt b/tests-py3.txt index a80fba0d7557..72a68da78260 100644 --- a/tests-py3.txt +++ b/tests-py3.txt @@ -21,9 +21,6 @@ nova.tests.unit.virt.libvirt.test_imagebackend.LvmTestCase nova.tests.unit.virt.libvirt.test_imagebackend.FlatTestCase nova.tests.unit.virt.libvirt.test_imagebackend.RbdTestCase nova.tests.unit.virt.libvirt.test_vif.LibvirtVifTestCase -nova.tests.unit.virt.vmwareapi.test_images.VMwareImagesTestCase -nova.tests.unit.virt.vmwareapi.test_read_write_util.ReadWriteUtilTestCase -nova.tests.unit.virt.vmwareapi.test_vmops.VMwareVMOpsTestCase.test_spawn_mask_block_device_info_password nova.tests.unit.virt.xenapi.test_vm_utils.ResizeFunctionTestCase nova.tests.unit.virt.xenapi.test_vm_utils.ScanSrTestCase nova.tests.unit.virt.xenapi.test_vm_utils.UnplugVbdTestCase