source: fedd/fedd_multistatus.py @ d743d60

axis_examplecompt_changesinfo-opsversion-3.01version-3.02
Last change on this file since d743d60 was d743d60, checked in by Ted Faber <faber@…>, 14 years ago

Totally refactor fedd_client.py into component scripts. The previous layout
have become a twisty hell of misdirected OOP and learning python run amok.
This version is actually pretty readable and will be much easier to build on.

  • Property mode set to 100755
File size: 1021 bytes
Line 
1#!/usr/local/bin/python
2
3import sys
4
5from federation.remote_service import service_caller
6from federation.client_lib import client_opts, exit_with_fault, RPCException, \
7        wrangle_standard_options, do_rpc, get_experiment_names
8
9parser = client_opts()
10(opts, args) = parser.parse_args()
11cert, fid = wrangle_standard_options(opts)
12
13try:
14    resp_dict = do_rpc({ },
15            opts.url, opts.transport, cert, opts.trusted, 
16            serialize_only=opts.serialize_only,
17            tracefile=opts.tracefile,
18            caller=service_caller('MultiInfo'),
19            responseBody='MultiInfoResponseBody')
20except RPCException, e:
21    exit_with_fault(e)
22except 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.
28for 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', "") ])
Note: See TracBrowser for help on using the repository browser.