Changeset a11eda5 for fedd/federation
- Timestamp:
- Feb 29, 2012 5:06:03 PM (13 years ago)
- Branches:
- compt_changes, master
- Children:
- 2bb8b35
- Parents:
- fe6e0be
- Location:
- fedd/federation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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))
Note: See TracChangeset
for help on using the changeset viewer.