Changeset 5d854e1 for fedd/fedd_image.py


Ignore:
Timestamp:
Sep 21, 2010 3:12:16 PM (9 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master
Children:
3bf0b3c
Parents:
87807f42
Message:

allow FEDD_URL in the environment to set the contact URL. Man am I sick of typing --url.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd_image.py

    r87807f42 r5d854e1  
    181181        raise RuntimeError("Bad response. %s" % e.message)
    182182
    183 def get_experiment_topo(opts, cert):
     183def get_experiment_topo(opts, cert, url):
    184184    """
    185185    Get the topology of an existing experiment from a running fedd.  That is,
     
    204204    req = { 'experiment': exp_id }
    205205    resp_dict = do_rpc(req,
    206             opts.url, opts.transport, cert, opts.trusted,
     206            url, opts.transport, cert, opts.trusted,
    207207            serialize_only=opts.serialize_only,
    208208            tracefile=opts.tracefile,
     
    211211    return extract_topo_from_message(resp_dict, opts.serialize_only)
    212212
    213 def get_file_topo(opts, cert):
     213def get_file_topo(opts, cert, url):
    214214    """
    215215    Parse a topology file or convert an ns2 file into a topdl.Topology.  XML
     
    238238    if opts.debug > 1: print >>sys.stderr, msg
    239239    resp_dict = do_rpc(msg,
    240             opts.url, opts.transport, cert, opts.trusted,
     240            url, opts.transport, cert, opts.trusted,
    241241            serialize_only=opts.serialize_only,
    242242            tracefile=opts.tracefile,
     
    252252# not be a big deal.  It's checked if needed below
    253253try:
    254     cert, fid = wrangle_standard_options(opts)
     254    cert, fid, url = wrangle_standard_options(opts)
    255255except RuntimeError, e:
    256256    cert = None
     
    285285        sys.exit("Couldn't find an identity certificate, RPC (Info) needed.")
    286286    try:
    287         top = get_experiment_topo(opts, cert)
     287        top = get_experiment_topo(opts, cert, url)
    288288    except RPCException, e:
    289289        exit_with_fault(e)
     
    296296                % opts.file
    297297    try:
    298         top = get_file_topo(opts, cert)
     298        top = get_file_topo(opts, cert, url)
    299299    except RPCException, e:
    300300        print >>sys.stderr, "Cannot extract a topology from %s" % opts.file
Note: See TracChangeset for help on using the changeset viewer.