- Timestamp:
- Mar 10, 2014 5:25:42 PM (11 years ago)
- Branches:
- master
- Children:
- d75005b
- Parents:
- a2ca699
- Location:
- fedd
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/deter/topdl.py
ra2ca699 r8fbef04 998 998 return t 999 999 1000 def generate_portal_command_filter(cmd, add_filter=None ):1000 def generate_portal_command_filter(cmd, add_filter=None, suffix=''): 1001 1001 def rv(e): 1002 1002 s ="" … … 1008 1008 add = True 1009 1009 if gw and add: 1010 s = "%s ${%s} \n" % (cmd, to_tcl_name(e.name))1010 s = "%s ${%s} %s\n" % (cmd, to_tcl_name(e.name), suffix) 1011 1011 return s 1012 1012 return rv -
fedd/federation/emulab_access.py
ra2ca699 r8fbef04 32 32 import list_log 33 33 import emulab_segment 34 import emulab_shared_nat_segment 34 35 35 36 … … 91 92 self.node_startcommand = config.get("access", "node_startcommand") 92 93 self.nat_portal = config.get("access", "nat_portal") 94 self.shared_nat = config.getboolean("access", "shared_nat") 93 95 94 96 self.uri = 'https://%s:%d' % (socket.getfqdn(), … … 100 102 101 103 self.access_type = self.access_type.lower() 102 self.start_segment = emulab_segment.start_segment 103 self.stop_segment = emulab_segment.stop_segment 104 self.info_segment = emulab_segment.info_segment 105 self.operation_segment = emulab_segment.operation_segment 106 self.exports_segment = emulab_segment.exports_segment 104 if self.shared_nat: 105 self.start_segment = emulab_shared_nat_segment.start_segment 106 self.stop_segment = emulab_shared_nat_segment.stop_segment 107 self.info_segment = emulab_shared_nat_segment.info_segment 108 self.operation_segment = emulab_shared_nat_segment.operation_segment 109 self.exports_segment = emulab_shared_nat_segment.exports_segment 110 else: 111 self.start_segment = emulab_segment.start_segment 112 self.stop_segment = emulab_segment.stop_segment 113 self.info_segment = emulab_segment.info_segment 114 self.operation_segment = emulab_segment.operation_segment 115 self.exports_segment = emulab_segment.exports_segment 107 116 108 117 self.restricted = [ ] … … 541 550 542 551 if self.portal_command: 552 if self.shared_nat: suffix = 'shared nat 0/0/tcp rdr 22/tcp' 553 else: suffix = '' 554 543 555 filters.append(topdl.generate_portal_command_filter( 544 self.portal_command, add_filter=add_filter ))556 self.portal_command, add_filter=add_filter, suffix=suffix)) 545 557 546 558 if self.portal_image: … … 977 989 debug=self.create_debug, log=alloc_log, boss=self.boss, 978 990 ops=self.ops, cert=xmlrpc_cert) 979 exporter(self, ename, proj, user, connInfo, tmpdir, gid) 991 if not exporter(self, ename, proj, user, connInfo, tmpdir, gid): 992 raise service_error(service_error.internal, 993 'Failed to gather export variables') 980 994 self.export_store_info(certfile, proj, ename, connInfo) 981 995 self.import_store_info(certfile, connInfo) -
fedd/federation/ssh_emulab_segment.py
ra2ca699 r8fbef04 59 59 return rv == 0 60 60 61 def scp_file_from(self, file, user, host, dest=""): 62 """ 63 scp a file to the remote host. If debug is set the action is only 64 logged. 65 """ 66 67 scp_cmd = [self.scp_exec, '-o', 'IdentitiesOnly yes', 68 '-o', 'StrictHostKeyChecking no', '-o', 'ForwardX11 no','-i', 69 self.ssh_privkey_file, "%s@%s:%s" % (user, host, file), dest] 70 rv = 0 71 72 try: 73 dnull = open("/dev/null", "w") 74 except EnvironmentError: 75 self.log.debug("[ssh_file]: failed to open " + \ 76 "/dev/null for redirect") 77 dnull = Null 78 79 self.log.debug("[scp_file]: %s" % " ".join(scp_cmd)) 80 if not self.debug: 81 rv = subprocess.call(scp_cmd, stdout=dnull, 82 stderr=dnull, close_fds=True) 83 84 return rv == 0 85 61 86 def ssh_cmd(self, user, host, cmd, wname=None, timeout=None): 62 87 """ -
fedd/federation/xmlrpc_emulab_segment.py
ra2ca699 r8fbef04 141 141 return state 142 142 143 def make_null_experiment(self, pid, eid, tmpdir, gid=None ):143 def make_null_experiment(self, pid, eid, tmpdir, gid=None, ns_str=None): 144 144 """ 145 145 Create a null copy of the experiment so that we capture any logs there 146 146 if the modify fails. Emulab software discards the logs from a failed 147 startexp. 148 """ 147 startexp. If ns_str is given, use that to construct the null 148 experiment. 149 """ 150 151 if ns_str is None: 152 ns_str = self.null 149 153 150 154 if self.debug: … … 157 161 'proj': pid, 158 162 'exp': eid, 159 'nsfilestr': self.null,163 'nsfilestr': ns_str, 160 164 'batch': False, 161 165 'idleswap': 0,
Note: See TracChangeset
for help on using the changeset viewer.