Changeset 05c41f5
- Timestamp:
- Oct 7, 2011 5:29:41 PM (13 years ago)
- Branches:
- compt_changes, info-ops, master
- Children:
- 58e5a4f
- Parents:
- 743a102
- Location:
- fedd/federation
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/emulab_access.py
r743a102 r05c41f5 933 933 user = None 934 934 alloc_log = None 935 nonce_experiment = False 935 936 vchars_re = '[^' + string.ascii_letters + string.digits + '-]' 936 937 … … 973 974 for i in range(0,5): 974 975 ename += random.choice(string.ascii_letters) 976 nonce_experiment = True 975 977 self.log.warn("No experiment name or suggestion too long: " + \ 976 978 "picked one randomly: %s" % ename) … … 988 990 user = self.allocation[aid].get('user', None) 989 991 self.allocation[aid]['experiment'] = ename 992 self.allocation[aid]['nonce'] = nonce_experiment 990 993 self.allocation[aid]['log'] = [ ] 991 994 # Create a logger that logs to the experiment's state object as … … 1162 1165 user = self.allocation[aid].get('user', None) 1163 1166 ename = self.allocation[aid].get('experiment', None) 1167 nonce = self.allocation[aid].get('nonce', False) 1164 1168 else: 1165 1169 proj = None 1166 1170 user = None 1167 1171 ename = None 1172 nonce = False 1168 1173 self.state_lock.release() 1169 1174 … … 1183 1188 stopper = self.stop_segment(keyfile=self.ssh_privkey_file, 1184 1189 debug=self.create_debug, boss=self.boss, cert=self.xmlrpc_cert) 1185 stopper(self, user, proj, ename, gid )1190 stopper(self, user, proj, ename, gid, nonce) 1186 1191 return { 'allocID': req['allocID'], 'proof': proof.to_dict() } -
fedd/federation/emulab_segment.py
r743a102 r05c41f5 156 156 return code == 0 157 157 158 def terminate_exp(self, pid, eid, wait=True): 159 """ 160 Completely terminate experiment 161 """ 162 if self.debug: 163 if self.log: 164 self.log.info("[swap_exp]: (debug) terminate %s" % eid) 165 return True 166 else: 167 if self.log: 168 self.log.info("[swap_exp]: Terminating %s" % (eid) 169 params = { 170 'proj': pid, 171 'exp': eid, 172 'wait': wait, 173 } 174 code, value = self.emulab_call('experiment.endexp', params) 175 176 if self.log: 177 if code == 0: self.log.info('[swap_exp]: Terminate succeeded') 178 else: self.log.error('[swap_exp]: Terminate failed: %s' % value) 179 180 return code == 0 181 158 182 def modify_exp(self, pid, eid, tcl, wait=True): 159 183 if self.debug: -
fedd/federation/local_emulab_segment.py
r743a102 r05c41f5 103 103 emulab_segment.__init__(self, boss=boss, cert=cert) 104 104 105 def __call__(self, parent, user, pid, eid, gid=None ):105 def __call__(self, parent, user, pid, eid, gid=None, terminate=False): 106 106 """ 107 107 Stop a sub experiment by calling swapexp on the federant … … 114 114 self.cmd_with_timeout("rm -rf /proj/%s/software/%s" % (pid, eid)) 115 115 rv = self.swap_exp(pid, eid, 'out') 116 if terminate: 117 rv = self.terminate_exp(pid, eid) 116 118 except self.cmd_timeout: 117 119 rv = False -
fedd/federation/proxy_emulab_segment.py
r743a102 r05c41f5 330 330 proxy_segment.__init__(self, log=log, keyfile=keyfile, debug=debug) 331 331 332 def __call__(self, parent, user, pid, eid, gid=None ):332 def __call__(self, parent, user, pid, eid, gid=None, terminate=False): 333 333 """ 334 334 Stop a sub experiment by calling swapexp on the federant … … 343 343 rv = self.ssh_cmd(user, host, 344 344 "/usr/testbed/bin/swapexp -w %s %s out" % (pid, eid)) 345 if terminate: 346 rv = self.ssh_cmd(user, host, 347 "/usr/testbed/bin/endexp -w %s %s" % (pid, eid)) 345 348 except self.ssh_cmd_timeout: 346 349 rv = False
Note: See TracChangeset
for help on using the changeset viewer.