Changeset f07fa49 for fedd/federation/access.py
- Timestamp:
- Sep 8, 2009 5:57:00 PM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-2.00, version-3.01, version-3.02
- Children:
- 40dd8c1
- Parents:
- 430e98d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/access.py
r430e98d rf07fa49 22 22 23 23 import topdl 24 import list_log 24 25 import httplib 25 26 import tempfile … … 782 783 msg = { 'ReleaseProjectRequestBody' : msg} 783 784 self.allocate_project.release_project(msg) 785 # And remove the access cert 786 cf = "%s/%s.pem" % (self.certdir, aid) 787 self.log.debug("Removing %s" % cf) 788 os.remove(cf) 784 789 return { 'allocID': req['allocID'] } 785 790 else: … … 1340 1345 user = self.allocation[aid].get('user', None) 1341 1346 self.allocation[aid]['experiment'] = ename 1347 self.allocation[aid]['log'] = [ ] 1348 # Create a logger that logs to the experiment's state object as 1349 # well as to the main log file. 1350 alloc_log = logging.getLogger('fedd.access.%s' % ename) 1351 h = logging.StreamHandler( 1352 list_log.list_log(self.allocation[aid]['log'])) 1353 # XXX: there should be a global one of these rather than 1354 # repeating the code. 1355 h.setFormatter(logging.Formatter( 1356 "%(asctime)s %(name)s %(message)s", 1357 '%d %b %y %H:%M:%S')) 1358 alloc_log.addHandler(h) 1342 1359 self.write_state() 1343 1360 self.state_lock.release() … … 1357 1374 self.generate_ns2(topo, expfile, 1358 1375 "/proj/%s/software/%s/" % (proj, ename), master) 1376 1359 1377 starter = self.start_segment(keyfile=self.ssh_privkey_file, 1360 debug=self.create_debug )1378 debug=self.create_debug, log=alloc_log) 1361 1379 rv = starter(self, ename, proj, user, expfile, tmpdir) 1362 1380 except service_error, e: … … 1373 1391 1374 1392 if rv: 1375 return { 'allocID': req['allocID'] } 1393 # Grab the log (this is some anal locking, but better safe than 1394 # sorry) 1395 self.state_lock.acquire() 1396 logv = "".join(self.allocation[aid]['log']) 1397 self.state_lock.release() 1398 1399 return { 'allocID': req['allocID'], 'allocationLog': logv } 1376 1400 elif err: 1377 1401 raise service_error(service_error.federant,
Note: See TracChangeset
for help on using the changeset viewer.