Changeset cd06678
- Timestamp:
- Mar 18, 2010 11:39:59 AM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- 1627c3d
- Parents:
- bdf00d5
- Location:
- fedd/federation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/emulab_access.py
rbdf00d5 rcd06678 1246 1246 """ 1247 1247 1248 call_SetValue = service_caller('SetValue', log=self.log) 1248 1249 for c in connInfo: 1249 1250 for p in [ p for p in c.get('parameter', []) \ … … 1257 1258 (k[k.index('/')+1:], ename, proj, self.domain) 1258 1259 req = { 'name': k, 'value': value } 1259 self.call_SetValue(surl, req, cf)1260 call_SetValue(surl, req, cf) 1260 1261 else: 1261 1262 self.log.error("Bad export request: %s" % p) … … 1265 1266 if surl and k: 1266 1267 req = { 'name': k, 'value': self.ssh_port } 1267 self.call_SetValue(surl, req, cf)1268 call_SetValue(surl, req, cf) 1268 1269 else: 1269 1270 self.log.error("Bad export request: %s" % p) … … 1336 1337 if not self.auth.check_attribute(fid, auth_attr): 1337 1338 raise service_error(service_error.access, "Access denied") 1339 else: 1340 # See if this is a replay of an earlier succeeded StartSegment - 1341 # sometimes SSL kills 'em. If so, replay the response rather than 1342 # redoing the allocation. 1343 self.state_lock.acquire() 1344 retval = self.allocation[aid].get('started', None) 1345 self.state_lock.release() 1346 if retval: 1347 self.log.warning("Duplicate StartSegment for %s: " % aid + \ 1348 "replaying response") 1349 return retval 1350 1351 # A new request. Do it. 1338 1352 1339 1353 if req.has_key('segmentdescription') and \ … … 1501 1515 self.state_lock.acquire() 1502 1516 logv = "".join(self.allocation[aid]['log']) 1517 # It's possible that the StartSegment call gets retried (!). 1518 # if the 'started' key is in the allocation, we'll return it rather 1519 # than redo the setup. 1520 self.allocation[aid]['started'] = { 1521 'allocID': req['allocID'], 1522 'allocationLog': logv, 1523 } 1524 retval = self.allocation[aid]['started'] 1503 1525 self.state_lock.release() 1504 1526 1505 return { 'allocID': req['allocID'], 'allocationLog': logv }1527 return retval 1506 1528 elif err: 1507 1529 raise service_error(service_error.federant, -
fedd/federation/protogeni_access.py
rbdf00d5 rcd06678 905 905 if not self.auth.check_attribute(fid, auth_attr): 906 906 raise service_error(service_error.access, "Access denied") 907 else: 908 # See if this is a replay of an earlier succeeded StartSegment - 909 # sometimes SSL kills 'em. If so, replay the response rather than 910 # redoing the allocation. 911 self.state_lock.acquire() 912 retval = self.allocation[aid].get('started', None) 913 self.state_lock.release() 914 if retval: 915 self.log.warning("Duplicate StartSegment for %s: " % aid + \ 916 "replaying response") 917 return retval 907 918 908 919 … … 1069 1080 self.state_lock.acquire() 1070 1081 logv = "".join(self.allocation[aid]['log']) 1082 # It's possible that the StartSegment call gets retried (!). 1083 # if the 'started' key is in the allocation, we'll return it rather 1084 # than redo the setup. 1085 self.allocation[aid]['started'] = { 1086 'allocID': req['allocID'], 1087 'allocationLog': logv, 1088 } 1089 retval = self.allocation[aid]['started'] 1071 1090 self.state_lock.release() 1072 1091 1073 return { 'allocID': req['allocID'], 'allocationLog': logv }1092 return retval 1074 1093 elif err: 1075 1094 raise service_error(service_error.federant,
Note: See TracChangeset
for help on using the changeset viewer.