#!/usr/bin/env python import sys from federation.proof import proof from federation.remote_service import service_caller from federation.client_lib import client_opts, exit_with_fault, RPCException, \ wrangle_standard_options, do_rpc, get_experiment_names, \ log_authentication parser = client_opts() (opts, args) = parser.parse_args() try: cert, fid, url = wrangle_standard_options(opts) except RuntimeError, e: sys.exit("%s" %e) try: resp_dict = do_rpc({ }, url, opts.transport, cert, opts.trusted, serialize_only=opts.serialize_only, tracefile=opts.tracefile, caller=service_caller('MultiInfo'), responseBody='MultiInfoResponseBody') except RPCException, e: exit_with_fault(e, 'MultiInfo', opts) except RuntimeError, e: sys.exit("Error processing RPC: %s" % e) # This is a terse way to print a line with the localname, fedid, and status of # each experiment, one line per experiment, separated by colons. for exp in resp_dict.get('info', []): f , l = get_experiment_names(exp.get('experimentID', None)) print ":".join([ l or "" , "%s" % (f or "") , exp.get('experimentStatus', "") ]) proof = proof.from_dict(resp_dict.get('proof', {})) if proof and opts.auth_log: log_authentication(opts.auth_log, 'MultiInfo', 'succeeded', proof)