Skip to content

Commit

Permalink
Merge "Port virt vmwareapi tests to Python 3"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Dec 17, 2016
2 parents b1ad95c + 3fe0faa commit 5029107
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 6 additions & 0 deletions nova/tests/unit/virt/vmwareapi/test_vmops.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,12 @@ def fake_debug(*args, **kwargs):
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:
Expand Down
3 changes: 2 additions & 1 deletion nova/virt/vmwareapi/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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
Expand Down Expand Up @@ -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))
Expand Down
3 changes: 0 additions & 3 deletions tests-py3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,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
Expand Down

0 comments on commit 5029107

Please sign in to comment.