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

autostart stays persistent after instance migration

This commit is contained in:
Ing. Jan KRCMAR 2017-03-09 14:26:55 +01:00
parent 20d0e5a09d
commit b5f9f638f1

View file

@ -571,7 +571,15 @@ def instance(request, compute_id, vname):
instance.compute = new_compute instance.compute = new_compute
instance.save() instance.save()
conn_migrate.close() conn_migrate.close()
msg = _("Migrate") if autostart:
conn_new = wvmInstance(new_compute.hostname,
new_compute.login,
new_compute.password,
new_compute.type,
vname)
conn_new.set_autostart(1)
conn_new.close()
msg = _("Migrate to %s" % new_compute.hostname)
addlogmsg(request.user.username, instance.name, msg) addlogmsg(request.user.username, instance.name, msg)
return HttpResponseRedirect(reverse('instance', args=[compute_id, vname])) return HttpResponseRedirect(reverse('instance', args=[compute_id, vname]))