Changeset 0a49bd7 for fedd/fedd_image.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_image.py

    rac15159 r0a49bd7  
    88
    99from federation import topdl
     10from federation.proof import proof
    1011from federation.remote_service import service_caller
    1112from federation.client_lib import client_opts, exit_with_fault, RPCException, \
    12         wrangle_standard_options, do_rpc, get_experiment_names, save_certfile
     13        wrangle_standard_options, do_rpc, get_experiment_names, save_certfile,\
     14        log_authentication
    1315
    1416
     
    1719        client_opts.__init__(self)
    1820        self.add_option("--experiment_cert", dest="exp_certfile",
    19                 type="string", help="experiment certificate file")
     21                action='callback', callback=self.expand_file, type='str',
     22                help="experiment certificate file")
    2023        self.add_option("--experiment_name", dest="exp_name",
    2124                type="string", help="human readable experiment name")
    22         self.add_option("--output", dest="outfile", type="string",
     25        self.add_option("--output", dest="outfile",
     26                action='callback', callback=self.expand_file, type='str',
    2327                help="output image file")
    2428        self.add_option("--format", dest="format", type="choice",
     
    3842                help="Size of output in pixels (diagrams are square")
    3943        self.add_option("--file", dest="file",
     44                action='callback', callback=self.expand_file, type='str',
    4045                help="experiment description file")
    4146        self.add_option("--group", dest="group", action="append", default=[],
     
    293298            caller=service_caller('Info'), responseBody="InfoResponseBody")
    294299
     300    proof = proof.from_dict(resp_dict.get('proof', {}))
     301    if proof and opts.auth_log:
     302        log_authentication(opts.auth_log, 'Image', 'succeeded', proof)
    295303    return extract_topo_from_message(resp_dict, opts.serialize_only)
    296304
     
    333341(opts, args) = parser.parse_args()
    334342
    335 # Note that if we're converting a local topdl file, the absence of a cert may
    336 # not be a big deal.  It's checked if needed below
     343# Note that if we're converting a local topdl file, the absence of a cert or
     344# abac directory may not be a big deal.  It's checked if needed below
    337345try:
    338346    cert, fid, url = wrangle_standard_options(opts)
    339347except RuntimeError, e:
    340348    cert = None
    341     print >>sys.stderr, "Warning: %s e"
     349    print >>sys.stderr, "Warning: %s" % e
    342350
    343351
     
    371379        top = get_experiment_topo(opts, cert, url)
    372380    except RPCException, e:
    373         exit_with_fault(e)
     381        exit_with_fault(e, 'image', opts)
    374382    except RuntimeError, e:
    375383        sys.exit("%s" % e)
     
    383391    except RPCException, e:
    384392        print >>sys.stderr, "Cannot extract a topology from %s" % opts.file
    385         exit_with_fault(e)
     393        exit_with_fault(e, 'image', opts)
    386394    except RuntimeError, e:
    387395        sys.exit("Cannot extract a topology from %s: %s" % (opts.file, e))
Note: See TracChangeset for help on using the changeset viewer.