Changeset 65f3f29 for fedd/federation
- Timestamp:
- Jul 25, 2009 10:52:45 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:
- ca489e8
- Parents:
- d27fd76
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/experiment_control.py
rd27fd76 r65f3f29 329 329 'Vis': soap_handler('Vis', self.get_vis), 330 330 'Info': soap_handler('Info', self.get_info), 331 'MultiInfo': soap_handler('MultiInfo', self.get_multi_info), 331 332 'Terminate': soap_handler('Terminate', 332 333 self.terminate_experiment), … … 338 339 'Vis': xmlrpc_handler('Vis', self.get_vis), 339 340 'Info': xmlrpc_handler('Info', self.get_info), 341 'MultiInfo': xmlrpc_handler('MultiInfo', self.get_multi_info), 340 342 'Terminate': xmlrpc_handler('Terminate', 341 343 self.terminate_experiment), … … 2177 2179 raise service_error(service_error.req, "No such experiment") 2178 2180 2181 def clean_info_response(self, rv): 2182 """ 2183 Remove the information in the experiment's state object that is not in 2184 the info response. 2185 """ 2186 # Remove the owner info (should always be there, but...) 2187 if rv.has_key('owner'): del rv['owner'] 2188 2189 # Convert the log into the allocationLog parameter and remove the 2190 # log entry (with defensive programming) 2191 if rv.has_key('log'): 2192 rv['allocationLog'] = "".join(rv['log']) 2193 del rv['log'] 2194 else: 2195 rv['allocationLog'] = "" 2196 2197 if rv['experimentStatus'] != 'active': 2198 if rv.has_key('federant'): del rv['federant'] 2199 else: 2200 # remove the allocationID info from each federant 2201 for f in rv.get('federant', []): 2202 if f.has_key('allocID'): del f['allocID'] 2203 2204 return rv 2205 2179 2206 def get_info(self, req, fid): 2180 2207 """ … … 2186 2213 if not req: 2187 2214 raise service_error(service_error.req, 2188 "Bad request format (no VisRequestBody)")2215 "Bad request format (no InfoRequestBody)") 2189 2216 exp = req.get('experiment', None) 2190 2217 if exp: … … 2211 2238 2212 2239 if rv: 2213 # Remove the owner info (should always be there, but...) 2214 if rv.has_key('owner'): del rv['owner'] 2215 2216 # Convert the log into the allocationLog parameter and remove the 2217 # log entry (with defensive programming) 2218 if rv.has_key('log'): 2219 rv['allocationLog'] = "".join(rv['log']) 2220 del rv['log'] 2221 else: 2222 rv['allocationLog'] = "" 2223 2224 if rv['experimentStatus'] != 'active': 2225 if rv.has_key('federant'): del rv['federant'] 2226 else: 2227 # remove the allocationID info from each federant 2228 for f in rv.get('federant', []): 2229 if f.has_key('allocID'): del f['allocID'] 2230 2231 return rv 2240 return self.clean_info_response(rv) 2232 2241 else: 2233 2242 raise service_error(service_error.req, "No such experiment") 2243 2244 def get_multi_info(self, req, fid): 2245 """ 2246 Return all the stored info that this fedid can access 2247 """ 2248 rv = { 'info': [ ] } 2249 2250 self.state_lock.acquire() 2251 for key in [ k for k in self.state.keys() if isinstance(k, fedid)]: 2252 self.check_experiment_access(fid, key) 2253 2254 if self.state.has_key(key): 2255 e = copy.deepcopy(self.state[key]) 2256 e = self.clean_info_response(e) 2257 rv['info'].append(e) 2258 self.state_lock.release() 2259 return rv 2234 2260 2235 2261
Note: See TracChangeset
for help on using the changeset viewer.