Ignore:
Timestamp:
Aug 10, 2009, 12:41:46 AM (15 years ago)
Author:
quentin
Message:

Show installer status on the front page, and unbreak the autoinstall fields in validation logic

Location:
package_branches/invirt-web/cherrypy/code
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • package_branches/invirt-web/cherrypy/code/main.py

    r2423 r2424  
    148148
    149149    def parseCreate(self, fields):
    150         kws = dict([(kw, fields.get(kw)) for kw in 'name description owner memory disksize vmtype cdrom autoinstall'.split()])
     150        kws = dict([(kw, fields.get(kw)) for kw in 'name description owner memory disksize vmtype cdrom autoinstall'.split() if fields.get(kw)])
    151151        validate = validation.Validate(cherrypy.request.login, cherrypy.request.state, strict=True, **kws)
    152152        return dict(contact=cherrypy.request.login, name=validate.name, description=validate.description, memory=validate.memory,
     
    375375    on = {}
    376376    has_vnc = {}
     377    installing = {}
    377378    xmlist = state.xmlist
    378379    checkpoint.checkpoint('Got uptimes')
    379     can_clone = 'ice3' not in state.xmlist_raw
    380380    for m in machines:
    381381        if m not in xmlist:
     
    390390            else:
    391391                has_vnc[m] = "ParaVM"
     392            if xmlist[m].get('autoinstall'):
     393                installing[m] = True
     394            else:
     395                installing[m] = False
    392396    max_memory = validation.maxMemory(username, state)
    393397    max_disk = validation.maxDisk(username)
     
    407411             machines=machines,
    408412             has_vnc=has_vnc,
    409              can_clone=can_clone)
     413             installing=installing)
    410414    return d
    411415
  • package_branches/invirt-web/cherrypy/code/templates/list.mako

    r2418 r2424  
    8585      <tr>
    8686        <td rowspan="2">
     87        % if machine.uptime and installing[machine]:
     88        <img src="static/power_installing.png" alt="Installing..." />
     89        % else:
    8790          <form action="machine/${machine.machine_id}/command/${'shutdown' if machine.uptime else 'create'}" method="post">
    8891            <input type="hidden" name="back" value="list"/>
     
    9598/>
    9699          </form>
     100          % endif
    97101        </td>
    98102        <td><a href="machine/${machine.machine_id}">${machine.name}</a></td>
Note: See TracChangeset for help on using the changeset viewer.