[d743d60] | 1 | #!/usr/local/bin/python |
---|
| 2 | |
---|
| 3 | import sys |
---|
| 4 | |
---|
| 5 | from federation.remote_service import service_caller |
---|
| 6 | from federation.client_lib import client_opts, exit_with_fault, RPCException, \ |
---|
| 7 | wrangle_standard_options, do_rpc, get_experiment_names |
---|
| 8 | |
---|
| 9 | parser = client_opts() |
---|
| 10 | (opts, args) = parser.parse_args() |
---|
[5d854e1] | 11 | cert, fid, url = wrangle_standard_options(opts) |
---|
[d743d60] | 12 | |
---|
| 13 | try: |
---|
| 14 | resp_dict = do_rpc({ }, |
---|
[5d854e1] | 15 | url, opts.transport, cert, opts.trusted, |
---|
[d743d60] | 16 | serialize_only=opts.serialize_only, |
---|
| 17 | tracefile=opts.tracefile, |
---|
| 18 | caller=service_caller('MultiInfo'), |
---|
| 19 | responseBody='MultiInfoResponseBody') |
---|
| 20 | except RPCException, e: |
---|
| 21 | exit_with_fault(e) |
---|
| 22 | except RuntimeError, e: |
---|
| 23 | sys.exit("Error processing RPC: %s" % e) |
---|
| 24 | |
---|
| 25 | |
---|
| 26 | # This is a terse way to print a line with the localname, fedid, and status of |
---|
| 27 | # each experiment, one line per experiment, separated by colons. |
---|
| 28 | for exp in resp_dict.get('info', []): |
---|
| 29 | f , l = get_experiment_names(exp.get('experimentID', None)) |
---|
| 30 | print ":".join([ l or "" , "%s" % (f or "") , |
---|
| 31 | exp.get('experimentStatus', "") ]) |
---|