Ignore:
Timestamp:
May 15, 2008, 9:55:17 PM (16 years ago)
Author:
ecprice
Message:

Use joins, new xmlist.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-www/code/main.py

    r516 r535  
    197197def getListDict(user):
    198198    """Gets the list of local variables used by list.tmpl."""
     199    checkpoint.checkpoint('Starting')
    199200    machines = g.machines
    200201    checkpoint.checkpoint('Got my machines')
    201202    on = {}
    202203    has_vnc = {}
    203     on = g.uptimes
     204    xmlist = g.xmlist
    204205    checkpoint.checkpoint('Got uptimes')
    205206    for m in machines:
    206         m.uptime = g.uptimes.get(m)
    207         if not on[m]:
     207        if m not in xmlist:
    208208            has_vnc[m] = 'Off'
    209         elif m.type.hvm:
    210             has_vnc[m] = True
     209            m.uptime = None
    211210        else:
    212             has_vnc[m] = "ParaVM"+helppopup("paravm_console")
     211            m.uptime = xmlist[m]['uptime']
     212            if xmlist[m]['console']:
     213                has_vnc[m] = True
     214            elif m.type.hvm:
     215                has_vnc[m] = "WTF?"
     216            else:
     217                has_vnc[m] = "ParaVM"+helppopup("paravm_console")
    213218    max_memory = validation.maxMemory(user)
    214219    max_disk = validation.maxDisk(user)
     
    228233             defaults=defaults,
    229234             machines=machines,
    230              has_vnc=has_vnc,
    231              uptimes=g.uptimes)
     235             has_vnc=has_vnc)
    232236    return d
    233237
     
    652656        checkpoint.checkpoint('output as a string')
    653657        print output_string
    654         print '<!-- <pre>%s</pre> -->' % checkpoint
     658        if fields.has_key('timedebug'):
     659            print '<pre>%s</pre>' % checkpoint
    655660    except Exception, err:
    656661        if not fields.has_key('js'):
     
    676681if __name__ == '__main__':
    677682    fields = cgi.FieldStorage()
     683
     684    if fields.has_key('sqldebug'):
     685        import logging
     686        logging.basicConfig()
     687        logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)
     688        logging.getLogger('sqlalchemy.orm.unitofwork').setLevel(logging.INFO)
     689
    678690    u = getUser()
    679691    g.user = u
Note: See TracChangeset for help on using the changeset viewer.