X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/4a421c824cd37a3b005f4d8c5ee58e05444b54f1..cfed63e6644aa489939f40a1ceff5b41e847aeca:/code/main.py diff --git a/code/main.py b/code/main.py index cfcbd5d..cd37c0e 100755 --- a/code/main.py +++ b/code/main.py @@ -36,12 +36,13 @@ import templates from Cheetah.Template import Template import validation import cache_acls -from webcommon import InvalidInput, CodeError, State +from webcommon import State import controls from getafsgroups import getAfsGroupMembers from invirt import database from invirt.database import Machine, CDROM, session, connect, MachineAccess, Type, Autoinstall from invirt.config import structs as config +from invirt.common import InvalidInput, CodeError def pathSplit(path): if path.startswith('/'): @@ -245,7 +246,7 @@ def vnc(username, state, path, fields): """ machine = validation.Validate(username, state, machine_id=fields.getfirst('machine_id')).machine - token = remctl('control', machine.name, 'vnctoken') + token = controls.remctl('control', machine.name, 'vnctoken').strip() host = controls.listHost(machine) if host: port = 10003 + [h.hostname for h in config.hosts].index(host)