X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/blobdiff_plain/ce218046309253419efd5665ab2fa507e87a1d01..a3265b122f84437fa9f63fd26297b5b616abd16f:/main.py diff --git a/main.py b/main.py index 29b410e..ab626e2 100755 --- a/main.py +++ b/main.py @@ -13,7 +13,6 @@ import sys import time from StringIO import StringIO - def revertStandardError(): """Move stderr to stdout, and return the contents of the old stderr.""" errio = sys.stderr @@ -184,8 +183,12 @@ def create(user, fields): def getListDict(user): - machines = [m for m in Machine.select() - if validation.haveAccess(user, m)] + machines = [m for m in Machine.select() + if validation.haveAccess(user, m)] + #if user == 'moo': + # machines = Machine.select() + #else: + # machines = Machine.query().join('users').filter_by(user=user).all() checkpoint.checkpoint('Got my machines') on = {} has_vnc = {} @@ -637,7 +640,8 @@ if __name__ == '__main__': if not operation: operation = 'list' - #main(operation, u, fields) - import profile - profile.run('main(operation, u, fields)', 'log-'+operation) - + if os.getenv("SIPB_XEN_PROFILE"): + import profile + profile.run('main(operation, u, fields)', 'log-'+operation) + else: + main(operation, u, fields)