Skip to content

Commit

Permalink
Merge pull request #1035 from grycap/devel
Browse files Browse the repository at this point in the history
Minor fix
  • Loading branch information
micafer authored Jun 29, 2020
2 parents 582b5f5 + 0fd7949 commit 7a1d247
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion IM/connectors/OpenStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -1307,17 +1307,19 @@ def finalize(self, vm, last, auth_data):
# First try to detach the volumes and the SGs
for vol_id in vm.volumes:
try:
self.log_debug("Dettaching volume %s." % vol_id)
volume = node.driver.ex_get_volume(vol_id)
node.driver.detach_volume(volume)
except Exception as ex:
self.log_exception("Error dettaching volume %s." % vol_id)

try:
for sg_name in self._get_security_names(vm.inf):
self.log_debug("Dettaching SG %s." % sg_name)
security_group = OpenStackSecurityGroup(None, None, sg_name, "", node.driver)
node.driver.ex_remove_security_group_from_node(security_group, node)
except Exception as ex:
self.log_exception("Error dettaching volume %s." % vol_id)
self.log_exception("Error dettaching SG %s." % sg_name)

res = node.destroy()
success.append(res)
Expand Down

0 comments on commit 7a1d247

Please sign in to comment.