Merge "Fix SMB volume detachment issue"
This commit is contained in:
commit
74830c0630
|
@ -410,10 +410,13 @@ class BaseVolumeDriver(object):
|
|||
# on this tag.
|
||||
if not self._is_block_dev:
|
||||
disk_path = self.get_disk_resource_path(connection_info)
|
||||
# In this case, we're not tagging the disks, so we want os-win
|
||||
# to use the disk path to identify the attachment.
|
||||
serial = None
|
||||
else:
|
||||
disk_path = None
|
||||
serial = connection_info['serial']
|
||||
|
||||
serial = connection_info['serial']
|
||||
LOG.debug("Detaching disk from instance: %(instance_name)s. "
|
||||
"Disk path: %(disk_path)s. Disk serial tag: %(serial)s.",
|
||||
dict(disk_path=disk_path,
|
||||
|
|
|
@ -624,9 +624,11 @@ class BaseVolumeDriverTestCase(test_base.HyperVBaseTestCase):
|
|||
mock.sentinel.instance_name)
|
||||
|
||||
if is_block_dev:
|
||||
exp_serial = connection_info['serial']
|
||||
exp_disk_res_path = None
|
||||
self.assertFalse(mock_get_disk_resource_path.called)
|
||||
else:
|
||||
exp_serial = None
|
||||
exp_disk_res_path = mock_get_disk_resource_path.return_value
|
||||
mock_get_disk_resource_path.assert_called_once_with(
|
||||
connection_info)
|
||||
|
@ -635,7 +637,7 @@ class BaseVolumeDriverTestCase(test_base.HyperVBaseTestCase):
|
|||
mock.sentinel.instance_name,
|
||||
exp_disk_res_path,
|
||||
is_physical=is_block_dev,
|
||||
serial=connection_info['serial'])
|
||||
serial=exp_serial)
|
||||
|
||||
def test_get_disk_ctrl_and_slot_ide(self):
|
||||
ctrl, slot = self._base_vol_driver._get_disk_ctrl_and_slot(
|
||||
|
|
Loading…
Reference in New Issue