source: trunk/packages/invirt-remote/server/usr/sbin/invirt-remote-list @ 2513

Last change on this file since 2513 was 2511, checked in by pweaver, 15 years ago

Added list script.
Lists a user's VM's (based on their tickets)

remctl list randomarg
remctl still requires an argument after list even though it doens't do anything

  • Property svn:executable set to *
File size: 536 bytes
Line 
1#!/usr/bin/python
2"""
3Returns a user's list of vm's
4"""
5
6from subprocess import PIPE, Popen, call
7import sys
8import os
9import yaml
10
11def main(argv):
12    if len(argv) < 1:
13        print >>sys.stderr, "usage: invirt-remote-list "
14        return 2
15    username = os.environ['REMUSER'].rsplit('@ATHENA.MIT.EDU')[0]
16    p = Popen(['/usr/sbin/invirt-remote-listuser', username], stdout=PIPE)
17    output = p.communicate()[0]
18
19    print output
20    return p.returncode
21
22if __name__ == '__main__':
23    sys.exit(main(sys.argv))
24
25# vim:et:sw=4:ts=4
Note: See TracBrowser for help on using the repository browser.