Changeset 239 for tbroadcast
- Timestamp:
- Aug 26, 2006, 5:03:33 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tbroadcast/v2/python/tbroadcast.py
r238 r239 12 12 import random 13 13 import commands 14 import traceback 14 15 15 16 from threadpool import WorkRequest … … 38 39 lines = string.split(output, '\n') 39 40 for line in lines: 40 if line [0] != '#':41 if line!='' and line [0] != '#': 41 42 if not cycle_found: 42 43 cycle_found = True … … 178 179 179 180 def suppress_work_unit (self, name): 180 print '# remove', name, 'from schedule'181 #print '# remove', name, 'from schedule' 181 182 for key in self.packages.keys(): 182 183 if name in self.packages[key]['dependencies']: … … 204 205 self.execute (command) 205 206 self.wait() 206 while self.is_work_units(): 207 self.wait() 207 ##while self.is_work_units(): 208 208 209 209 def wait (self): … … 213 213 def result_callback(self, request, result): 214 214 #print "**Result: %s from request #%s" % (str(result), request.requestID) 215 print "# Result: %s from request #%s" % (result['package'], request.requestID)215 #print "# Result: %s from request #%s" % (result['package'], request.requestID) 216 216 self.execute (result['cmd']) 217 217 218 218 # the work the threads will have to do 219 219 def do_execute(self, arg): 220 path = self.get_work_area_path (arg['package']) 220 path = self.get_work_area_path (arg['package']) 221 self.set_work_unit_status (arg['package'], 'running') 222 cmd = "cmt -use="+ arg['package'] + " run '"+ arg['cmd'] + "'" 223 os.chdir(path) 221 224 print '#--------------------------------------------------------------' 222 225 print '# Now trying ['+ arg['cmd']+'] in ' + path 223 226 print '#--------------------------------------------------------------' 224 self.set_work_unit_status (arg['package'], 'running')225 cmd = "cmt -use="+ arg['package'] + " run '"+ arg['cmd'] + "'"226 os.chdir(path)227 227 cmd = arg['cmd'] 228 228 status, output, error, pythonError = exeCommand(cmd, iTimeout = 10) … … 234 234 # raise RuntimeError(output) 235 235 return {'output':output, 'cmd': arg['cmd'], 'package':arg['package']} 236 236 237 237 # this will be called when an exception occurs within a thread 238 238 def handle_exception(self, request, exc_info): 239 #traceback.print_stack() 239 240 print "# Exception occured in request #%s: %s" % \ 240 241 (request.requestID, exc_info[1])
Note: See TracChangeset
for help on using the changeset viewer.