Changeset 0a49bd7 for fedd/fedd_new.py


Ignore:
Timestamp:
Jan 15, 2011 5:52:15 PM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master
Children:
aaf7f41
Parents:
ac15159 (diff), 944b746 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Ted Faber <faber@…> (01/15/11 17:51:40)
git-committer:
Ted Faber <faber@…> (01/15/11 17:52:15)
Message:

merge from current

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd_new.py

    rac15159 r0a49bd7  
    22
    33import sys
     4from datetime import datetime
    45
    56from federation.fedid import fedid, generate_fedid
    67from federation.remote_service import service_caller
     8from federation.proof import proof
    79from federation.client_lib import client_opts, exit_with_fault, RPCException, \
    810        wrangle_standard_options, do_rpc, get_experiment_names, \
    9         save_certfile, get_abac_certs
    10 
     11        save_certfile, get_abac_certs, log_authentication
    1112
    1213class new_opts(client_opts):
     
    1415        client_opts.__init__(self)
    1516        self.add_option("--experiment_cert", dest="out_certfile",
    16                 type="string", help="output certificate file")
     17                action='callback', callback=self.expand_file, type='str',
     18                help="output certificate file")
    1719        self.add_option("--experiment_name", dest="exp_name",
    1820                type="string", help="Suggested experiment name")
     
    2426(opts, args) = parser.parse_args()
    2527
    26 cert, fid, url = wrangle_standard_options(opts)
    2728try:
     29    cert, fid, url = wrangle_standard_options(opts)
    2830    acerts = get_abac_certs(opts.abac_dir)
    2931except EnvironmentError, e:
    3032    sys.exit('%s: %s' % (e.filename, e.strerror))
     33except RuntimeError, e:
     34    sys.exit("%s" %e)
    3135
    3236out_certfile = opts.out_certfile
     
    5559            caller=service_caller("New"), responseBody='NewResponseBody')
    5660except RPCException, e:
    57     exit_with_fault(e)
     61    exit_with_fault(e, 'New', opts)
    5862except RuntimeError, e:
    5963    sys.exit("Error processing RPC: %s" % e)
     
    7276e_fedid, e_local = get_experiment_names(resp_dict.get('experimentID', None))
    7377st = resp_dict.get('experimentStatus', None)
     78proof = proof.from_dict(resp_dict.get('proof', {}))
    7479
    7580if e_local: print "localname: %s" % e_local
    7681if e_fedid: print "fedid: %s" % e_fedid
    7782if st: print "status: %s" % st
     83if proof and opts.auth_log:
     84    log_authentication(opts.auth_log, 'New', 'succeeded', proof)
Note: See TracChangeset for help on using the changeset viewer.