mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 15:15:22 +00:00
Delete instance disk: detach and delete. Notification added if detach completed but not deleted
This commit is contained in:
parent
537cefe90a
commit
c212a60bba
1 changed files with 7 additions and 3 deletions
|
@ -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')
|
||||
|
||||
|
|
Loading…
Reference in a new issue