return None
return out.strip()
+def vnctoken(machine):
+ """Return a time-stamped VNC token"""
+ out, err = remctl('control', machine.name, 'vnctoken')
+ if err:
+ return None
+ return out.strip()
+
def deleteVM(machine):
"""Delete a VM."""
remctl('control', machine.name, 'destroy', err=True)
from invirt.database import Machine, CDROM, session, connect, MachineAccess, Type, Autoinstall
from invirt.config import structs as config
from invirt.common import InvalidInput, CodeError
-from invirt.remctl import remctl
def pathSplit(path):
if path.startswith('/'):
"""
machine = validation.Validate(username, state, machine_id=fields.getfirst('machine_id')).machine
- token = controls.remctl('control', machine.name, 'vnctoken').strip()
+ token = control.vnctoken(machine)
host = controls.listHost(machine)
if host:
port = 10003 + [h.hostname for h in config.hosts].index(host)