Changeset 80b1e82 for fedd/federation
- Timestamp:
- Nov 18, 2011 7:19:48 PM (13 years ago)
- Branches:
- compt_changes, info-ops, master
- Children:
- 9294673
- Parents:
- 29d5f7c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/experiment_control.py
r29d5f7c r80b1e82 1892 1892 self.state_lock.acquire() 1893 1893 # XXX: this needs to be recalculated 1894 if self.state.has_key(key): 1895 if self.state[key].has_key('vtopo'): 1894 if key in self.state: 1895 if self.state[key].top is not None: 1896 vtopo = topdl.topology_to_vtopo(self.state[key].top) 1896 1897 rv = { 'experiment' : {keytype: key }, 1897 'vtopo': self.state[key]['vtopo'],1898 'vtopo': vtopo, 1898 1899 'proof': proof.to_dict(), 1899 1900 } 1900 1901 else: 1901 state = self.state[key] ['experimentStatus']1902 state = self.state[key].status 1902 1903 self.state_lock.release() 1903 1904 … … 1937 1938 1938 1939 self.state_lock.acquire() 1939 # XXX: this needs to be recalculated 1940 if self.state.has_key(key): 1941 if self.state[key].has_key('vis'): 1942 rv = { 'experiment' : {keytype: key }, 1943 'vis': self.state[key]['vis'], 1940 # Generate the visualization 1941 if key in self.state: 1942 if self.state[key].top is not None: 1943 try: 1944 vis = self.genviz( 1945 topdl.topology_to_vtopo(self.state[key].topo)) 1946 except service_error, e: 1947 self.state_lock.release() 1948 raise e 1949 rv = { 'experiment' : {keytype: key }, 1950 'vis': vis, 1944 1951 'proof': proof.to_dict(), 1945 1952 } 1946 1953 else: 1947 state = self.state[key] ['experimentStatus']1954 state = self.state[key].status 1948 1955 self.state_lock.release() 1949 1956 … … 2210 2217 "Bad request format (no InfoRequestBody)") 2211 2218 exp = req.get('experiment', None) 2219 legacy = req.get('legacy', False) 2212 2220 if exp: 2213 2221 if exp.has_key('fedid'): … … 2227 2235 if self.state.has_key(key): 2228 2236 rv = self.state[key].get_info() 2237 # Copy the topo if we need to generate legacy representations 2238 if legacy: 2239 top = self.state[key].top 2240 if top is not None: top = top.clone() 2229 2241 self.state_lock.release() 2230 2242 2243 # If the legacy visualization and topology representations are 2244 # requested, calculate them and add them to teh return. 2245 if legacy and rv is not None: 2246 if top is not None: 2247 vtopo = topdl.topology_to_vtopo(top) 2248 if vtopo is not None: 2249 rv['vtopo'] = vtopo 2250 try: 2251 vis = self.genviz(vtopo) 2252 except service_error, e: 2253 self.log.debug('Problem generating visualization: %s' \ 2254 % e) 2255 vis = None 2256 if vis is not None: 2257 rv['vis'] = vis 2231 2258 if rv: 2232 2259 rv['proof'] = proof.to_dict()
Note: See TracChangeset
for help on using the changeset viewer.