[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() |
---|
[a0c2866] | 11 | try: |
---|
| 12 | cert, fid, url = wrangle_standard_options(opts) |
---|
| 13 | except RuntimeError, e: |
---|
| 14 | sys.exit("%s" %e) |
---|
[d743d60] | 15 | |
---|
| 16 | try: |
---|
| 17 | resp_dict = do_rpc({ }, |
---|
[5d854e1] | 18 | url, opts.transport, cert, opts.trusted, |
---|
[d743d60] | 19 | serialize_only=opts.serialize_only, |
---|
| 20 | tracefile=opts.tracefile, |
---|
| 21 | caller=service_caller('MultiInfo'), |
---|
| 22 | responseBody='MultiInfoResponseBody') |
---|
| 23 | except RPCException, e: |
---|
| 24 | exit_with_fault(e) |
---|
| 25 | except RuntimeError, e: |
---|
| 26 | sys.exit("Error processing RPC: %s" % e) |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | # This is a terse way to print a line with the localname, fedid, and status of |
---|
| 30 | # each experiment, one line per experiment, separated by colons. |
---|
| 31 | for exp in resp_dict.get('info', []): |
---|
| 32 | f , l = get_experiment_names(exp.get('experimentID', None)) |
---|
| 33 | print ":".join([ l or "" , "%s" % (f or "") , |
---|
| 34 | exp.get('experimentStatus', "") ]) |
---|