1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 23:25:24 +00:00

Delete instance disk: detach and delete. Notification added if detach completed but not deleted

This commit is contained in:
catborise 2019-10-28 11:20:39 +03:00
parent 537cefe90a
commit c212a60bba

View file

@ -576,10 +576,14 @@ def instance(request, compute_id, vname):
path = request.POST.get('path', '')
name = request.POST.get('name', '')
conn.detach_disk(dev)
conn_delete.del_volume(name)
msg = _('Delete disk: ' + dev)
conn.detach_disk(dev)
try:
conn_delete.del_volume(name)
except libvirtError as err:
msg = _('The disk: ' + dev + ' is detached but not deleted. ' + err.message)
messages.warning(request, msg)
addlogmsg(request.user.username, instance.name, msg)
return HttpResponseRedirect(request.get_full_path() + '#disks')