Ignore:
Timestamp:
Jun 25, 2010 3:11:30 AM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
1027cf7
Parents:
e11f4e0
Message:

Add support for user-supplied testbed mappings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd_create.py

    re11f4e0 rfd07c48  
    2828                type="string", default=[],
    2929                help="Service description name:exporters:importers:attrs")
     30        self.add_option("--map", dest="map", action="append",
     31                type="string", default=[],
     32                help="Explicit map from testbed label to URI - " + \
     33                        "deter:https://users.isi.deterlab/net:13232")
    3034
    3135def parse_service(svc):
     
    102106        for l in lines if service_re.match(l)])
    103107
     108# Create a testbed map if one is specified
     109tbmap = { }
     110for m in opts.map:
     111    i = m.find(":")
     112    if i != -1: tbmap[m[0:i]] = m[i+1:]
     113    else: sys.exit("Bad mapping argument: %s" %m )
     114
     115
    104116if not svcs:
    105117    print >>sys.stderr, "Warning:Neither master/project nor services requested"
     
    147159    sys.exit("New did not return an experiment ID??")
    148160
     161if tbmap:
     162    msg['testbedmap'] = [ { 'testbed': t, 'uri': u } for t, u in tbmap.items() ]
     163
    149164if opts.debug > 1: print >>sys.stderr, msg
    150165
Note: See TracChangeset for help on using the changeset viewer.