Changeset a11eda5
- Timestamp:
- Feb 29, 2012 5:06:03 PM (13 years ago)
- Branches:
- compt_changes, master
- Children:
- 2bb8b35
- Parents:
- fe6e0be
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/fedd_create.py
rfe6e0be ra11eda5 45 45 type="string", default=[], 46 46 help="Service description name:exporters:importers:attrs") 47 self.add_option('--active', action='append', default=[], type='string', 48 help='a testbed that prefers active protal nodes in the map') 47 49 self.add_option("--map", dest="map", action="append", 48 50 type="string", default=[], … … 310 312 311 313 if tbmap: 312 msg['testbedmap'] = [ { 'testbed': t, 'uri': u } for t, u in tbmap.items() ] 314 msg['testbedmap'] = [ 315 { 316 'testbed': t, 317 'uri': u, 318 'active': t in opts.active, 319 } for t, u in tbmap.items() 320 ] 313 321 314 322 if opts.debug > 1: print >>sys.stderr, msg -
fedd/federation/experiment_control.py
rfe6e0be ra11eda5 385 385 Read a simple colon separated list of mappings for the 386 386 label-to-testbed-URL mappings. Clears or creates self.tbmap. 387 also adds testbeds to active if they include , active after 388 their name. 387 389 """ 388 390 389 391 self.tbmap = { } 392 self.tbactive = set() 390 393 lineno =0 391 394 try: … … 398 401 try: 399 402 label, url = line.split(':', 1) 403 if ',' in label: 404 label, act = label.split(',', 1) 405 active = (act.strip() == 'active') 406 else: 407 active = False 400 408 self.tbmap[label] = url 409 if active: self.tbactive.add(label) 401 410 except ValueError, e: 402 411 self.log.warn("[read_mapdb] Ignored bad line (%d) in " +\ … … 2132 2141 # of the testbed map. 2133 2142 tbmap = dict(self.tbmap) 2143 tbactive = set(self.tbactive) 2134 2144 for m in req.get('testbedmap', []): 2135 2145 if 'testbed' in m and 'uri' in m: 2136 2146 tbmap[m['testbed']] = m['uri'] 2147 if 'active' in m and m['active']: tbactive.add(m['testbed']) 2137 2148 2138 2149 # a place to work … … 2182 2193 2183 2194 part = experiment_partition(self.auth, self.store_url, tbmap, 2184 self.muxmax, self.direct_transit )2195 self.muxmax, self.direct_transit, tbactive) 2185 2196 part.add_portals(top, topo, eid, pmasters, tbparams, ip_allocator, 2186 2197 connInfo, expid) -
fedd/federation/experiment_partition.py
rfe6e0be ra11eda5 44 44 class experiment_partition: 45 45 def __init__(self, auth=None, store_url=None, tbmap=None, muxmax=2, 46 direct_transit=None ):46 direct_transit=None, tbactive=None): 47 47 """ 48 48 Intialize the various attributes … … 56 56 self.direct_transit = direct_transit or [ ] 57 57 self.muxmax = muxmax 58 self.tbactive = tbactive 58 59 59 60 … … 89 90 ddomain = tbparams[dt].get_attribute('domain', '.example.com') 90 91 91 if (st in masters and dt not in masters) or \ 92 if (st in self.tbactive and dt not in self.tbactive) or \ 93 ( st not in self.tbactive and dt in self.tbactive ): 94 active = ("%s" % (st in self.tbactive)) 95 elif (st in masters and dt not in masters) or \ 92 96 ( st not in masters and dt in masters ): 93 97 active = ("%s" % (st in masters)) -
wsdl/fedd_types.xsd
rfe6e0be ra11eda5 237 237 systems the information to map the local name into a service 238 238 location. 239 240 The optional active element is true when the testbed prefers active 241 portal nodes. 239 242 </xsd:documentation> 240 243 </xsd:annotation> … … 242 245 <xsd:element name="testbed" type="xsd:string"/> 243 246 <xsd:element name="uri" type="xsd:string"/> 247 <xsd:element name="active" type="xsd:boolean" 248 minOccurs="0" maxOccurs="1"/> 244 249 </xsd:sequence> 245 250 </xsd:complexType>
Note: See TracChangeset
for help on using the changeset viewer.