mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
Added is_template attribute to instances. If true, instance cannot be started.
This commit is contained in:
parent
4ab8561360
commit
646bdbbe0e
4 changed files with 39 additions and 3 deletions
|
|
@ -66,6 +66,7 @@ def instances(request):
|
|||
check_uuid = Instance.objects.get(compute_id=comp.id, name=vm)
|
||||
if check_uuid.uuid != info['uuid']:
|
||||
check_uuid.save()
|
||||
all_host_vms[comp.id, comp.name][vm]['is_template'] = check_uuid.is_template
|
||||
except Instance.DoesNotExist:
|
||||
check_uuid = Instance(compute_id=comp.id, name=vm, uuid=info['uuid'])
|
||||
check_uuid.save()
|
||||
|
|
@ -515,6 +516,13 @@ def instance(request, compute_id, vname):
|
|||
addlogmsg(request.user.username, instance.name, msg)
|
||||
return HttpResponseRedirect(request.get_full_path() + '#network')
|
||||
|
||||
if 'change_template' in request.POST:
|
||||
instance.is_template = request.POST.get('is_template', False)
|
||||
instance.save()
|
||||
msg = _("Edit template %s" % instance.is_template)
|
||||
addlogmsg(request.user.username, instance.name, msg)
|
||||
return HttpResponseRedirect(request.get_full_path() + '#template')
|
||||
|
||||
conn.close()
|
||||
|
||||
except libvirtError as lib_err:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue