Added "web vgcapacity" probe for disk utilization.
[invirt/packages/invirt-remote.git] / server / usr / sbin / invirt-remote-list
1 #!/usr/bin/python
2 """
3 Lists the VMs belonging to the remote user.
4 """
5
6 from subprocess import PIPE, Popen, call
7 import sys
8 import os
9
10
11 def main(argv):
12     if len(argv) < 1:
13         print >>sys.stderr, "usage: invirt-remote-list"
14         return 2
15
16     username = os.environ['REMOTE_USER'].rsplit('@ATHENA.MIT.EDU')[0]
17     p = Popen(['/usr/sbin/invirt-remote-listuser', username], stdout=PIPE)
18     output = p.communicate()[0]
19
20     print output
21     return p.returncode
22
23
24 if __name__ == '__main__':
25     sys.exit(main(sys.argv))