Changeset 1615


Ignore:
Timestamp:
Nov 11, 2008, 4:32:18 AM (15 years ago)
Author:
broder
Message:

Pull the vnctoken remctl into the controls module

Location:
trunk/packages/invirt-web/code
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-web/code/controls.py

    r1614 r1615  
    168168    """Return the host a machine is running on"""
    169169    out, err = remctl('control', machine.name, 'listhost', err=True)
     170    if err:
     171        return None
     172    return out.strip()
     173
     174def vnctoken(machine):
     175    """Return a time-stamped VNC token"""
     176    out, err = remctl('control', machine.name, 'vnctoken')
    170177    if err:
    171178        return None
  • trunk/packages/invirt-web/code/main.py

    r1613 r1615  
    4444from invirt.config import structs as config
    4545from invirt.common import InvalidInput, CodeError
    46 from invirt.remctl import remctl
    4746
    4847def pathSplit(path):
     
    248247    machine = validation.Validate(username, state, machine_id=fields.getfirst('machine_id')).machine
    249248
    250     token = controls.remctl('control', machine.name, 'vnctoken').strip()
     249    token = control.vnctoken(machine)
    251250    host = controls.listHost(machine)
    252251    if host:
Note: See TracChangeset for help on using the changeset viewer.