Changeset ca489e8 for fedd/federation
- Timestamp:
- Jul 27, 2009 9:41:25 AM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
- Children:
- 8f32dc0
- Parents:
- 65f3f29
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/experiment_control.py
r65f3f29 rca489e8 252 252 # NB for internal master/slave ops, not experiment setup 253 253 self.ssh_type = config.get("experiment_control", "sshkeytype", "rsa") 254 255 self.overrides = set([]) 256 ovr = config.get('experiment_control', 'overrides') 257 if ovr: 258 for o in ovr.split(","): 259 o = o.strip() 260 if o.startswith('fedid:'): o = o[len('fedid:'):] 261 self.overrides.add(fedid(hexstr=o)) 262 254 263 self.state = { } 255 264 self.state_lock = Lock() … … 408 417 if f.has_key('fedid') ]: 409 418 self.auth.set_attribute(self.state[k]['owner'], eid) 419 # allow overrides to control experiments as well 420 for o in self.overrides: 421 self.auth.set_attribute(o, eid) 410 422 except KeyError, e: 411 423 self.log.warning("[read_state]: State ownership or identity " +\ … … 2009 2021 self.auth.set_attribute(fid, expid) 2010 2022 self.auth.set_attribute(expid, expid) 2023 # Override fedids can manipulate state as well 2024 for o in self.overrides: 2025 self.auth.set_attribute(o, expid) 2011 2026 2012 2027 # Create a logger that logs to the experiment's state object as well as … … 2270 2285 raise service_error(service_error.req, 2271 2286 "Bad request format (no TerminateRequestBody)") 2287 force = req.get('force', False) 2272 2288 exp = req.get('experiment', None) 2273 2289 if exp: … … 2298 2314 if status: 2299 2315 if status == 'starting': 2300 self.state_lock.release() 2301 raise service_error(service_error.partial, 2302 'Experiment still being created') 2316 if not force: 2317 self.state_lock.release() 2318 raise service_error(service_error.partial, 2319 'Experiment still being created') 2320 else: 2321 self.log.warning('Experiment in starting state ' + \ 2322 'being terminated by admin.') 2303 2323 else: 2304 2324 # No status??? trouble … … 2361 2381 2362 2382 # release the allocations (failed experiments have done this 2363 # already) 2364 if status != 'failed': 2383 # already, and starting experiments may be in odd states, so we 2384 # ignore errors releasing those allocations 2385 try: 2365 2386 for tb in tbparams.keys(): 2366 2387 self.release_access(tb, tbparams[tb]['aid']) 2388 except service_error, e: 2389 if status != 'failed' and not force: 2390 raise e 2367 2391 2368 2392 # Remove the terminated experiment
Note: See TracChangeset
for help on using the changeset viewer.