Last change
on this file since 2392 was
1822,
checked in by broder, 16 years ago
|
Merge invirt-remote-host and invirt-remote-server into invirt-remote
|
-
Property svn:executable set to
*
|
File size:
631 bytes
|
Rev | Line | |
---|
[562] | 1 | #!/usr/bin/python |
---|
[538] | 2 | |
---|
| 3 | """ |
---|
| 4 | Collates the results of listvms from multiple VM servers. Part of the xvm |
---|
| 5 | suite. |
---|
| 6 | """ |
---|
| 7 | |
---|
[816] | 8 | from invirt.remote import bcast |
---|
[563] | 9 | import sys |
---|
| 10 | import yaml |
---|
[538] | 11 | |
---|
| 12 | def main(argv): |
---|
[816] | 13 | # Query each of the hosts. |
---|
| 14 | results = filter(lambda (_, x): x is not None, bcast('listvms')) |
---|
[538] | 15 | |
---|
[561] | 16 | # Merge the results and print. |
---|
| 17 | merged = {} |
---|
[623] | 18 | for server, result in results: |
---|
| 19 | for data in result.itervalues(): |
---|
| 20 | data['host'] = server |
---|
[561] | 21 | merged.update(result) |
---|
[616] | 22 | |
---|
[564] | 23 | print yaml.dump(merged, Dumper=yaml.CSafeDumper, default_flow_style=False) |
---|
[538] | 24 | |
---|
| 25 | if __name__ == '__main__': |
---|
[816] | 26 | sys.exit(main(sys.argv)) |
---|
[538] | 27 | |
---|
[617] | 28 | # vim:et:sw=4:ts=4 |
---|
Note: See
TracBrowser
for help on using the repository browser.