#!/usr/bin/python """ Lists what a user's VM's are """ from subprocess import PIPE, Popen, call import sys import yaml from invirt import database from invirt.database import Machine, MachineAccess def main(argv): if len(argv) < 2: print >>sys.stderr, "usage: invirt-remote-listuser " return 2 username = argv[1] database.connect() machines = Machine.query().join('acl').filter_by(user=username) output = "Machine Name \t\t Owner \t\t contact \n\r" for m in machines: output += m.name + "\t" + m.owner +"\t" + m.contact + "\n\r" print output return 0 if __name__ == '__main__': sys.exit(main(sys.argv)) # vim:et:sw=4:ts=4