Changeset ca489e8
- 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
- Location:
- fedd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/fedd_client.py
r65f3f29 rca489e8 157 157 help="data to extract") 158 158 159 class fedd_terminate_opts(fedd_exp_data_opts): 160 def __init__(self): 161 fedd_exp_data_opts.__init__(self) 162 self.add_option("--force", dest="force", 163 action="store_true", default=False, 164 help="Force termination if experiment is in strange state") 165 159 166 class fedd_multi_exp_data_opts(fedd_client_opts): 160 167 def __init__(self): … … 1024 1031 """ 1025 1032 # Process the options using the customized option parser defined above 1026 parser = fedd_ exp_data_opts()1033 parser = fedd_terminate_opts() 1027 1034 1028 1035 (opts, args) = parser.parse_args() … … 1061 1068 "--experiment_name"); 1062 1069 1063 req = { 'experiment': exp_id }1070 req = { 'experiment': exp_id, 'force': opts.force } 1064 1071 1065 1072 try: -
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 -
fedd/wsdl/fedd_types.xsd
r65f3f29 rca489e8 595 595 <xsd:sequence> 596 596 <xsd:element name="experiment" type="tns:IDType"/> 597 <xsd:element name="force" type="xsd:boolean" minOccurs="0" maxOccurs="1"/> 597 598 </xsd:sequence> 598 599 </xsd:complexType>
Note: See TracChangeset
for help on using the changeset viewer.