Changeset 4ffa6f8 for fedd/federation
- Timestamp:
- Jul 12, 2012 5:48:44 PM (12 years ago)
- Branches:
- compt_changes, master
- Children:
- 87b1a06
- Parents:
- 4708875
- Location:
- fedd/federation
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/access.py
r4708875 r4ffa6f8 95 95 self.cert_file = config.get("globals", "cert_file") 96 96 self.sert_pwd = config.get("globals", "cert_pw") 97 98 self.nat_portal = None 97 99 98 100 self.trusted_certs = config.get("access", "trusted_certs") or \ … … 490 492 'value': self.dragon_vlans}) 491 493 494 if self.nat_portal is not None: 495 msg['fedAttr'].append({'attribute': 'nat_portals', 'value': True}) 496 492 497 if services: 493 498 msg['service'] = services … … 626 631 627 632 active = info.get('active', 'False') 633 nat_partner = info.get('nat_partner', 'False') 628 634 629 635 cfn = "%s/%s.gw.conf" % (tmpdir, myname.lower()) … … 638 644 if s.get('name', "") in self.imports]: 639 645 server_service_out[s['name']](f, s) 646 647 if nat_partner == 'True': 648 print >>f, "nat_partner: True" 640 649 641 650 if tunnelconfig: -
fedd/federation/emulab_access.py
r4708875 r4ffa6f8 90 90 self.portal_startcommand = config.get("access", "portal_startcommand") 91 91 self.node_startcommand = config.get("access", "node_startcommand") 92 self.nat_portal = config.get("access", "nat_portal") 92 93 93 94 self.uri = 'https://%s:%d' % (socket.getfqdn(), … … 552 553 k = p.get('key', None) 553 554 surl = p.get('store', None) 554 if surl and k and k.index('/') != -1: 555 value = "%s.%s.%s%s" % \ 555 if surl : 556 if self.nat_portal: 557 value = self.nat_portal 558 elif k and k.index('/') != -1: 559 value = "%s.%s.%s%s" % \ 556 560 (k[k.index('/')+1:], ename, proj, self.domain) 557 req = { 'name': k, 'value': value } 561 else: 562 self.log.error("Bad export request: %s" % p) 563 continue 558 564 self.log.debug("Setting %s to %s on %s" % \ 559 565 (k, value, surl)) 566 req = { 'name': k, 'value': value } 560 567 self.call_SetValue(surl, req, cf) 561 568 else: -
fedd/federation/experiment_control.py
r4708875 r4ffa6f8 327 327 328 328 self.tbmap = { } 329 self.tbactive = set()330 329 lineno =0 331 330 try: … … 338 337 try: 339 338 label, url = line.split(':', 1) 340 if ',' in label:341 label, act = label.split(',', 1)342 active = (act.strip() == 'active')343 else:344 active = False345 339 self.tbmap[label] = url 346 if active: self.tbactive.add(label)347 340 except ValueError, e: 348 341 self.log.warn("[read_mapdb] Ignored bad line (%d) in " +\ … … 2169 2162 # of the testbed map. 2170 2163 tbmap = dict(self.tbmap) 2171 tbactive = set(self.tbactive)2172 2164 for m in req.get('testbedmap', []): 2173 2165 if 'testbed' in m and 'uri' in m: 2174 2166 tbmap[m['testbed']] = m['uri'] 2175 if 'active' in m and m['active']: tbactive.add(m['testbed'])2176 2167 2177 2168 # a place to work … … 2213 2204 connInfo = { } # Connection information 2214 2205 2215 self.split_topology(top, topo, testbeds)2216 2217 2206 self.get_access_to_testbeds(testbeds, fid, allocated, 2218 2207 tbparams, masters, tbmap, expid, expcert_file) 2208 2209 # tbactive is the set of testbeds that have NATs in front of their 2210 # portals. They need to initiate connections. 2211 tbactive = set([k for k, v in tbparams.items() \ 2212 if v.get_attribute('nat_portals')]) 2213 2214 self.split_topology(top, topo, testbeds) 2219 2215 2220 2216 attrs = self.generate_keys_and_hosts(tmpdir, expid, hosts, tbparams) -
fedd/federation/experiment_partition.py
r4708875 r4ffa6f8 93 93 ( st not in self.tbactive and dt in self.tbactive ): 94 94 active = ("%s" % (st in self.tbactive)) 95 nat_partner = ("%s" % (dt in self.tbactive)) 95 96 elif (st in masters and dt not in masters) or \ 96 97 ( st not in masters and dt in masters ): 97 98 active = ("%s" % (st in masters)) 99 nat_partner = "%s" % False 98 100 else: 99 101 active = ("%s" % (st > dt)) 102 nat_partner = "%s" % False 100 103 101 104 ifaces = [ ] … … 127 130 "%s/%s" % (mproject, eid)}, 128 131 { 'attribute': 'active', 'value': active}, 132 { 'attribute': 'nat_partner', 'value': nat_partner}, 129 133 # Move to SMB service description 130 134 { 'attribute': 'masteruser', 'value': muser},
Note: See TracChangeset
for help on using the changeset viewer.