summaryrefslogtreecommitdiff
path: root/nova/virt/vmwareapi/driver.py
diff options
context:
space:
mode:
authorClaudiu Belu <cbelu@cloudbasesolutions.com>2018-03-28 01:36:24 -0700
committerClaudiu Belu <cbelu@cloudbasesolutions.com>2018-03-29 14:25:53 +0000
commitad4a26e1843bc4cefa2c5b4bb093d692cddfaa49 (patch)
tree198a7ad4b928cdbd06ffefd6e018a43e05f9fc78 /nova/virt/vmwareapi/driver.py
parent3f08521d33c60e4bfe04bc236bb8761f654004df (diff)
downloadnova-ad4a26e1843bc4cefa2c5b4bb093d692cddfaa49.tar.gz
vmware: Fixes _detach_instance_volumes method
The _detach_instance_volumes method calls self.detach_volume with an invalid number of arguments (context missing), causing it to fail. This patch solves the issue. Change-Id: Ibb6afa883c4ed55ea544a1e9d247dab4fc657cd2 Closes-Bug: #1759609
Diffstat (limited to 'nova/virt/vmwareapi/driver.py')
-rw-r--r--nova/virt/vmwareapi/driver.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/nova/virt/vmwareapi/driver.py b/nova/virt/vmwareapi/driver.py
index f6c4d5336b..d8f3854c86 100644
--- a/nova/virt/vmwareapi/driver.py
+++ b/nova/virt/vmwareapi/driver.py
@@ -404,6 +404,8 @@ class VMwareVCDriver(driver.ComputeDriver):
def detach_volume(self, context, connection_info, instance, mountpoint,
encryption=None):
"""Detach volume storage to VM instance."""
+ # NOTE(claudiub): if context parameter is to be used in the future,
+ # the _detach_instance_volumes method will have to be updated as well.
return self._volumeops.detach_volume(connection_info, instance)
def get_volume_connector(self, instance):
@@ -435,7 +437,9 @@ class VMwareVCDriver(driver.ComputeDriver):
for disk in block_device_mapping:
connection_info = disk['connection_info']
try:
- self.detach_volume(connection_info, instance,
+ # NOTE(claudiub): Passing None as the context, as it is
+ # not currently used.
+ self.detach_volume(None, connection_info, instance,
disk.get('device_name'))
except exception.DiskNotFound:
LOG.warning('The volume %s does not exist!',