source: fedd/fedd_multistatus.py @ dffa585

Last change on this file since dffa585 was 2e46f35, checked in by mikeryan <mikeryan@…>, 14 years ago

switch to /usr/bin/env python to run python

  • Property mode set to 100755
File size: 1.3 KB
RevLine 
[2e46f35]1#!/usr/bin/env python
[d743d60]2
3import sys
4
[e83f2f2]5from federation.proof import proof
[d743d60]6from federation.remote_service import service_caller
7from federation.client_lib import client_opts, exit_with_fault, RPCException, \
[e83f2f2]8        wrangle_standard_options, do_rpc, get_experiment_names, \
9        log_authentication
[d743d60]10
11parser = client_opts()
12(opts, args) = parser.parse_args()
[a0c2866]13try:
14    cert, fid, url = wrangle_standard_options(opts)
15except RuntimeError, e:
16    sys.exit("%s" %e)
[d743d60]17
18try:
19    resp_dict = do_rpc({ },
[5d854e1]20            url, opts.transport, cert, opts.trusted, 
[d743d60]21            serialize_only=opts.serialize_only,
22            tracefile=opts.tracefile,
23            caller=service_caller('MultiInfo'),
24            responseBody='MultiInfoResponseBody')
25except RPCException, e:
[e83f2f2]26    exit_with_fault(e, 'MultiInfo', opts)
[d743d60]27except RuntimeError, e:
28    sys.exit("Error processing RPC: %s" % e)
29
30
31# This is a terse way to print a line with the localname, fedid, and status of
32# each experiment, one line per experiment, separated by colons.
33for exp in resp_dict.get('info', []):
34    f , l = get_experiment_names(exp.get('experimentID', None))
35    print ":".join([ l or "" , "%s" % (f or "") , 
36        exp.get('experimentStatus', "") ])
[e83f2f2]37proof = proof.from_dict(resp_dict.get('proof', {}))
38if proof and opts.auth_log:
39    log_authentication(opts.auth_log, 'MultiInfo', 'succeeded', proof)
Note: See TracBrowser for help on using the repository browser.