Browse Source

Merge "vmware: Handle folder renames in rescue cmd"

changes/71/788471/3
Zuul 2 weeks ago
committed by Gerrit Code Review
parent
commit
294b30b281
2 changed files with 5 additions and 3 deletions
  1. +3
    -2
      nova/tests/unit/virt/vmwareapi/test_vmops.py
  2. +2
    -1
      nova/virt/vmwareapi/vmops.py

+ 3
- 2
nova/tests/unit/virt/vmwareapi/test_vmops.py View File

@ -407,7 +407,7 @@ class VMwareVMOpsTestCase(test.NoDBTestCase):
backing = vmwareapi_fake.DataObject()
backing.datastore = ds.ref
device.backing = backing
vmdk = vm_util.VmdkInfo('[fake] uuid/root.vmdk',
vmdk = vm_util.VmdkInfo('[fake] test (uuid)/root.vmdk',
'fake-adapter',
'fake-disk',
'fake-capacity',
@ -428,7 +428,8 @@ class VMwareVMOpsTestCase(test.NoDBTestCase):
uuid = self._instance.image_ref
cache_path = ds.build_path('vmware_base', uuid, uuid + '.vmdk')
rescue_path = ds.build_path(self._uuid, uuid + '-rescue.vmdk')
vm_folder = ds_obj.DatastorePath.parse(vmdk.path).dirname
rescue_path = ds.build_path(vm_folder, uuid + '-rescue.vmdk')
mock_disk_copy.assert_called_once_with(self._session, dc_info.ref,
cache_path, rescue_path)


+ 2
- 1
nova/virt/vmwareapi/vmops.py View File

@ -1225,7 +1225,8 @@ class VMwareVMOps(object):
self._fetch_image_if_missing(context, vi)
# Get the rescue disk path
rescue_disk_path = datastore.build_path(instance.uuid,
vm_folder = ds_obj.DatastorePath.parse(vmdk.path).dirname
rescue_disk_path = datastore.build_path(vm_folder,
"%s-rescue.%s" % (image_info.image_id, image_info.file_type))
# Copy the cached image to the be the rescue disk. This will be used


Loading…
Cancel
Save