Changeset fd556d1
- Timestamp:
- Sep 6, 2009 3:11:36 PM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-2.00, version-3.01, version-3.02
- Children:
- e19b75c
- Parents:
- 2b7d768
- Location:
- fedd/federation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/access.py
r2b7d768 rfd556d1 1353 1353 self.generate_ns2(topo, expfile, 1354 1354 "/proj/%s/software/%s/" % (proj, ename), master) 1355 starter = self.start_segment(keyfile=self.ssh_privkey_file, debug=self.create_debug) 1356 starter(self, ename, proj, user, expfile, tmpdir) 1357 1358 return { 'allocID': req['allocID'] } 1355 starter = self.start_segment(keyfile=self.ssh_privkey_file, 1356 debug=self.create_debug) 1357 rv = starter(self, ename, proj, user, expfile, tmpdir) 1358 if rv: 1359 return { 'allocID': req['allocID'] } 1360 else: 1361 raise service_error(service_error.federant, "Swapin failed") 1359 1362 1360 1363 def TerminateSegment(self, req, fid): … … 1392 1395 raise service_error(service_error.internal, 1393 1396 "Can't find experiment name for %s" % aid) 1394 stopper = self.stop_segment(keyfile=self.ssh_privkey_file, debug=self.create_debug) 1397 stopper = self.stop_segment(keyfile=self.ssh_privkey_file, 1398 debug=self.create_debug) 1395 1399 stopper(self, user, proj, ename) 1396 print { 'allocID': req['allocID'] }1397 1400 return { 'allocID': req['allocID'] } -
fedd/federation/experiment_control.py
r2b7d768 rfd556d1 2143 2143 2144 2144 class new_start_segment: 2145 def __init__(self, debug=False, log=None, cert_file=None,2145 def __init__(self, debug=False, log=None, testbed="", cert_file=None, 2146 2146 cert_pwd=None, trusted_certs=None, caller=None): 2147 2147 self.log = log … … 2151 2151 self.trusted_certs = None 2152 2152 self.caller = caller 2153 self.testbed = testbed 2153 2154 2154 2155 def __call__(self, uri, aid, topo, master, attrs=None): … … 2163 2164 req['fedAttr'] = attrs 2164 2165 2165 print req 2166 r = self.caller(uri, req, self.cert_file, self.cert_pwd, 2167 self.trusted_certs) 2168 print r 2169 return True 2166 try: 2167 r = self.caller(uri, req, self.cert_file, self.cert_pwd, 2168 self.trusted_certs) 2169 return True 2170 except service_error, e: 2171 self.log.error("Start segment failed on %s: %s" % \ 2172 (self.testbed, e)) 2173 return False 2170 2174 2171 2175 2172 2176 2173 2177 class new_terminate_segment: 2174 def __init__(self, debug=False, log=None, cert_file=None,2178 def __init__(self, debug=False, log=None, testbed="", cert_file=None, 2175 2179 cert_pwd=None, trusted_certs=None, caller=None): 2176 2180 self.log = log … … 2180 2184 self.trusted_certs = None 2181 2185 self.caller = caller 2186 self.testbed = testbed 2182 2187 2183 2188 def __call__(self, uri, aid ): … … 2186 2191 'allocID': aid , 2187 2192 } 2188 r = self.caller(uri, req, self.cert_file, self.cert_pwd, 2189 self.trusted_certs) 2190 return True 2193 try: 2194 r = self.caller(uri, req, self.cert_file, self.cert_pwd, 2195 self.trusted_certs) 2196 return True 2197 except service_error, e: 2198 self.log.error("Terminate segment failed on %s: %s" % \ 2199 (self.testbed, e)) 2200 return False 2191 2201 2192 2202 … … 2224 2234 t = self.pooled_thread(\ 2225 2235 target=self.new_start_segment(log=log, debug=self.debug, 2226 cert_file=self.cert_file, cert_pwd=self.cert_pwd, 2236 testbed=tb, cert_file=self.cert_file, 2237 cert_pwd=self.cert_pwd, 2227 2238 trusted_certs=self.trusted_certs, 2228 2239 caller=self.call_StartSegment), … … 2251 2262 "No alloc id for testbed %s !?" % master) 2252 2263 starter = self.new_start_segment(log=log, debug=self.debug, 2253 cert_file=self.cert_file, cert_pwd=self.cert_pwd,2254 trusted_certs=self.trusted_certs,2264 testbed=master, cert_file=self.cert_file, 2265 cert_pwd=self.cert_pwd, trusted_certs=self.trusted_certs, 2255 2266 caller=self.call_StartSegment) 2256 2267 if not starter(uri, aid, topo[master], True, attrs): … … 2267 2278 t = self.pooled_thread(\ 2268 2279 target=self.stop_segment(log=log, 2280 testbed=tb, 2269 2281 keyfile=self.ssh_privkey_file, 2270 2282 debug=self.debug), … … 3358 3370 t = self.pooled_thread(\ 3359 3371 target=self.new_terminate_segment(log=dealloc_log, 3372 testbed=tb, 3360 3373 cert_file=self.cert_file, 3361 3374 cert_pwd=self.cert_pwd,
Note: See TracChangeset
for help on using the changeset viewer.