Changeset 239 for tbroadcast


Ignore:
Timestamp:
Aug 26, 2006, 5:03:33 PM (18 years ago)
Author:
garonne
Message:

bug fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tbroadcast/v2/python/tbroadcast.py

    r238 r239  
    1212import random
    1313import commands
     14import traceback
    1415
    1516from threadpool import WorkRequest
     
    3839        lines = string.split(output, '\n')
    3940        for line in lines:           
    40             if line [0] != '#':           
     41            if line!='' and line [0] != '#':           
    4142                if not cycle_found:
    4243                    cycle_found = True
     
    178179
    179180    def suppress_work_unit (self, name):
    180         print '# remove', name, 'from schedule'
     181        #print '# remove', name, 'from schedule'
    181182        for key in self.packages.keys():
    182183            if name in self.packages[key]['dependencies']:
     
    204205        self.execute (command)
    205206        self.wait()
    206         while self.is_work_units():
    207             self.wait()   
     207        ##while self.is_work_units():
    208208       
    209209    def wait (self):
     
    213213    def result_callback(self, request, result):
    214214      #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)
    216216      self.execute (result['cmd'])
    217217
    218218    # the work the threads will have to do
    219219    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)       
    221224        print '#--------------------------------------------------------------'
    222225        print '# Now trying ['+ arg['cmd']+'] in ' + path
    223226        print '#--------------------------------------------------------------'
    224         self.set_work_unit_status (arg['package'], 'running')     
    225         cmd = "cmt -use="+ arg['package'] + " run '"+ arg['cmd'] + "'"
    226         os.chdir(path)
    227227        cmd = arg['cmd']
    228228        status, output, error, pythonError  = exeCommand(cmd,  iTimeout = 10)     
     
    234234        #   raise RuntimeError(output)
    235235        return {'output':output, 'cmd': arg['cmd'], 'package':arg['package']}
    236                
     236             
    237237    # this will be called when an exception occurs within a thread
    238238    def handle_exception(self, request, exc_info):
     239        #traceback.print_stack()
    239240        print "# Exception occured in request #%s: %s" % \
    240241          (request.requestID, exc_info[1])
Note: See TracChangeset for help on using the changeset viewer.