Changeset 8fbef04 for fedd/federation
- Timestamp:
- Mar 10, 2014 5:25:42 PM (11 years ago)
- Branches:
- master
- Children:
- d75005b
- Parents:
- a2ca699
- Location:
- fedd/federation
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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.