mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
experimental: external snapshot fixes 2
This commit is contained in:
parent
06994b0423
commit
f4aa925e2a
2 changed files with 5 additions and 1 deletions
|
@ -1056,10 +1056,13 @@ def revert_external_snapshot(request, pk):
|
|||
if allow_admin_or_not_template and request.user.has_perm(
|
||||
"instances.snapshot_instances"
|
||||
):
|
||||
instance_state = True if instance.proxy.get_status() != 5 else False
|
||||
name = request.POST.get("name", "")
|
||||
date = request.POST.get("date", "")
|
||||
desc = request.POST.get("desc", "")
|
||||
instance.proxy.revert_external_snapshot(name, instance, date, desc)
|
||||
instance.proxy.force_shutdown() if instance_state else None
|
||||
instance.proxy.revert_external_snapshot(name, date, desc)
|
||||
instance.proxy.start() if instance_state else None
|
||||
msg = _("Revert external snapshot: %(snap)s") % {"snap": name}
|
||||
addlogmsg(request.user.username, instance.compute.name, instance.name, msg)
|
||||
return redirect(request.META.get("HTTP_REFERER") + "#managesnapshot")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue