def getListDict(user):
"""Gets the list of local variables used by list.tmpl."""
+ checkpoint.checkpoint('Starting')
machines = g.machines
checkpoint.checkpoint('Got my machines')
on = {}
has_vnc = {}
- on = g.uptimes
+ xmlist = g.xmlist
checkpoint.checkpoint('Got uptimes')
for m in machines:
- m.uptime = g.uptimes.get(m)
- if not on[m]:
+ if m not in xmlist:
has_vnc[m] = 'Off'
- elif m.type.hvm:
- has_vnc[m] = True
+ m.uptime = None
else:
- has_vnc[m] = "ParaVM"+helppopup("paravm_console")
+ m.uptime = xmlist[m]['uptime']
+ if xmlist[m]['console']:
+ has_vnc[m] = True
+ elif m.type.hvm:
+ has_vnc[m] = "WTF?"
+ else:
+ has_vnc[m] = "ParaVM"+helppopup("paravm_console")
max_memory = validation.maxMemory(user)
max_disk = validation.maxDisk(user)
checkpoint.checkpoint('Got max mem/disk')
max_disk=max_disk,
defaults=defaults,
machines=machines,
- has_vnc=has_vnc,
- uptimes=g.uptimes)
+ has_vnc=has_vnc)
return d
def listVms(user, fields):
output_string = str(output)
checkpoint.checkpoint('output as a string')
print output_string
- print '<!-- <pre>%s</pre> -->' % checkpoint
+ if fields.has_key('timedebug'):
+ print '<pre>%s</pre>' % checkpoint
except Exception, err:
if not fields.has_key('js'):
if isinstance(err, CodeError):
if __name__ == '__main__':
fields = cgi.FieldStorage()
+
+ if fields.has_key('sqldebug'):
+ import logging
+ logging.basicConfig()
+ logging.getLogger('sqlalchemy.engine').setLevel(logging.INFO)
+ logging.getLogger('sqlalchemy.orm.unitofwork').setLevel(logging.INFO)
+
u = getUser()
g.user = u
operation = os.environ.get('PATH_INFO', '')