Changeset 4a02274
- Timestamp:
- Mar 10, 2014 11:12:49 AM (11 years ago)
- Branches:
- master
- Children:
- a2ca699
- Parents:
- 26821ac (diff), dffa585 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/desktop_access.py
r26821ac r4a02274 418 418 print >>f, 'sleep 60; done' 419 419 print >>f, ('ssh -w 0:0 -p %s -o "Tunnel ethernet" ' + \ 420 '-o "StrictHostKeyChecking no" -i %s %s perl -I/usr/local/federation/lib /usr/local/federation/bin/setup_bridge.pl --tapno=0 --addr=%s &') % \420 '-o "StrictHostKeyChecking no" -i %s %s perl -I/usr/local/federation/lib /usr/local/federation/bin/setup_bridge.pl --tapno=0 --addr=%s --use_file &') % \ 421 421 (port, self.ssh_identity, peer, my_addr) 422 422 # This should give the tap a a chance to come up -
fedd/federation/emulab_access.py
rdffa585 r4a02274 104 104 self.info_segment = emulab_segment.info_segment 105 105 self.operation_segment = emulab_segment.operation_segment 106 self.exports_segment = emulab_segment.exports_segment 106 107 107 108 self.restricted = [ ] … … 563 564 def export_store_info(self, cf, proj, ename, connInfo): 564 565 """ 565 For the export requests in the connection info, install the peer names 566 at the experiment controller via SetValue calls. 566 For the export requests in the connection info, send out teh SetValue 567 calls for parameters initialized by the segment's export_segment 568 object. Values are all in the connInfo parameter's value fields. 567 569 """ 568 570 569 571 for c in connInfo: 570 for p in [ p for p in c.get('parameter', []) \ 571 if p.get('type', '') == 'output']: 572 573 if p.get('name', '') == 'peer': 574 k = p.get('key', None) 575 surl = p.get('store', None) 576 if surl : 577 if self.nat_portal: 578 value = self.nat_portal 579 elif k and k.index('/') != -1: 580 value = "%s.%s.%s%s" % \ 581 (k[k.index('/')+1:], ename, proj, self.domain) 582 else: 583 self.log.error("Bad export request: %s" % p) 584 continue 585 self.log.debug("Setting %s to %s on %s" % \ 586 (k, value, surl)) 587 req = { 'name': k, 'value': value } 588 self.call_SetValue(surl, req, cf) 589 else: 590 self.log.error("Bad export request: %s" % p) 591 elif p.get('name', '') == 'ssh_port': 592 k = p.get('key', None) 593 surl = p.get('store', None) 594 if surl and k: 595 req = { 'name': k, 'value': self.ssh_port } 596 self.log.debug("Setting %s to %s on %s" % \ 597 (k, self.ssh_port, surl)) 598 self.call_SetValue(surl, req, cf) 599 else: 600 self.log.error("Bad export request: %s" % p) 601 else: 602 self.log.error("Unknown export parameter: %s" % \ 572 for p in c.get('parameter', []): 573 # Ignore non-output parameters 574 if p.get('type', '') != 'output': 575 continue 576 # Sanity check store, key and value 577 surl = p.get('store', None) 578 key = p.get('key', None) 579 value = p.get('value', None) 580 if surl is None: 581 self.log.error("Export parameter without store: %s" % \ 603 582 p.get('name')) 604 583 continue 584 if key is None: 585 self.log.error("Export parameter without key: %s" % \ 586 p.get('name')) 587 continue 588 if value is None: 589 self.log.error("Unknown (unset) export parameter: %s" % \ 590 p.get('name')) 591 continue 592 # Set the store value 593 req = { 'name': key, 'value': value } 594 self.call_SetValue(surl, req, cf) 605 595 606 596 def add_seer_node(self, topo, name, startup): … … 984 974 self.configure_seer_services(services, topo, softdir) 985 975 # Get and send synch store variables 976 exporter = self.exports_segment(keyfile=self.ssh_privkey_file, 977 debug=self.create_debug, log=alloc_log, boss=self.boss, 978 ops=self.ops, cert=xmlrpc_cert) 979 exporter(self, ename, proj, user, connInfo, tmpdir, gid) 986 980 self.export_store_info(certfile, proj, ename, connInfo) 987 981 self.import_store_info(certfile, connInfo) -
fedd/federation/emulab_segment.py
rdffa585 r4a02274 181 181 self.do_operation(op, l, p, param, top) 182 182 return True 183 184 class exports_segment(ssh_emulab_segment, xmlrpc_emulab_segment): 185 ''' 186 Class to export parameters from this segment. For a standard segment these 187 are calculated, so there is no testbed interaction. For shared-NAT DETER 188 installations, this is more involved. This class is a hook for that more 189 involved setup. 190 ''' 191 def __init__(self, log=None, keyfile=None, debug=False, boss=None, 192 ops=None, cert=None): 193 ssh_emulab_segment.__init__(self, log=log, keyfile=keyfile, debug=debug) 194 xmlrpc_emulab_segment.__init__(self, boss=boss, ops=ops, cert=cert) 195 196 def __call__(self, parent, eid, pid, user, connInfo, tmpdir, timeout=0, 197 gid=None): 198 ''' 199 Install the parameter values into each output parameter in each 200 connInfo entry. This class understands peer and ssh_port output 201 variables. 202 ''' 203 204 for c in connInfo: 205 for p in c.get('parameter', []): 206 # Only set output parameters 207 if p.get('type', '') != 'output': 208 continue 209 name = p.get('name', '') 210 # Debugging output 211 k = p.get('key', None) 212 if name == 'peer': 213 if parent.nat_portal: 214 value = parent.nat_portal 215 elif k and k.index('/') != -1: 216 value = "%s.%s.%s%s" % \ 217 (k[k.index('/')+1:], eid, pid, parent.domain) 218 else: 219 self.log.error("Bad export request: %s" % p) 220 continue 221 p['value'] = value 222 self.log.debug("Assigning %s to %s" % (k, value)) 223 elif name == 'ssh_port': 224 value = parent.ssh_port 225 p['value'] = value 226 self.log.debug("Assigning %s to %s" % (k, value)) 227 else: 228 self.log.error("Unknown export parameter: %s" % \ 229 p.get('name')) 230 continue 231 return True -
fedkit/gateway_lib.pm
r26821ac r4a02274 434 434 } 435 435 436 # Fling a few ping packets at the peer in the hopes that it opens doors through 437 # NATs and other filters. Practically speaking this can make a big difference. 438 sub ping_peer { 439 my($peer) = @_; 440 system("ping -c 5 $peer"); 441 } 442 436 443 sub testcmd_repeat { 437 444 my($cmd, $timeout, $sleep) = @_; -
fedkit/prep_gateway.pl
r26821ac r4a02274 89 89 # appear in the DNS. 90 90 foreach my $p (split(/\s*,\s*/, $peer)) { 91 gateway_lib::add_route($p, $router, 1, 60 *60) 92 if $p && $router; 91 if ($p && $router ) { 92 gateway_lib::add_route($p, $router, 1, 60 *60); 93 # grease the skids 94 gateway_lib::ping_peer($p); 95 } 93 96 } 94 97 } -
fedkit/setup_bridge.pl
r26821ac r4a02274 13 13 my $fedkit_dir= "/usr/local/federation"; 14 14 my $perl = "/usr/bin/perl"; 15 my $peer; 15 16 my $use_file; 16 17 my %opts = ( … … 18 19 'addr=s' => \$addr, 19 20 'dest=s' => \$dest, 21 'peer=s' => \$peer, 20 22 'use_file', \$use_file, 21 23 ); 22 24 23 25 exit(20) unless GetOptions(%opts); 24 gateway_lib::read_config(gateway_lib:: emulab_config_filename(), \%opts)26 gateway_lib::read_config(gateway_lib::config_filename(), \%opts) 25 27 if $use_file; 26 28 … … 34 36 35 37 gateway_lib::bind_tap_to_iface($tapno, $iface); 38 gateway_lib::ping_peer($peer) 39 if $peer; 36 40 37 41 exit(0);
Note: See TracChangeset
for help on using the changeset viewer.