Last change
on this file since 2512 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
|
Rev | Line | |
---|
[2511] | 1 | #!/usr/bin/python |
---|
| 2 | """ |
---|
| 3 | Returns a user's list of vm's |
---|
| 4 | """ |
---|
| 5 | |
---|
| 6 | from subprocess import PIPE, Popen, call |
---|
| 7 | import sys |
---|
| 8 | import os |
---|
| 9 | import yaml |
---|
| 10 | |
---|
| 11 | def 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 | |
---|
| 22 | if __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.