Changeset 86 for trunk/daemon


Ignore:
Timestamp:
04/18/05 14:40:58 (19 years ago)
Author:
bastiaans
Message:

daemon/togad.py:

  • Rewrote node adding to jobs
  • Misc cleanup
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/togad.py

    r84 r86  
    160160                id = self.getDatabase( "SELECT job_id FROM jobs WHERE job_id = '%s'" %jobid )
    161161
    162                 print id
    163 
    164162                if id:
    165163
     
    185183
    186184                debug_msg( 6, 'mutateJob(): %s %s' %(action,job_id))
    187                 print jobattrs
    188185
    189186                for valname, value in jobattrs.items():
    190 
    191                         print valname, value
    192187
    193188                        if valname in job_values and value:
     
    217212
    218213                                self.addNodes( value )
    219                                 #ids = self.getNodeIds( value )
    220 
    221                                 #for id in ids:
    222                                 #       self.addJobNode( job_id, id )
     214                                node_list = value
    223215
    224216                if action == 'insert':
    225217
    226218                        self.setDatabase( "INSERT INTO jobs ( %s ) VALUES ( %s )" %( insert_col_str, insert_val_str ) )
     219                        ids = self.getNodeIds( node_list )
     220
     221                        self.addJobNodes( self. job_id, ids )
    227222                elif action == 'update':
    228223
     
    238233                                self.setDatabase( "INSERT INTO nodes ( node_hostname ) VALUES ( '%s' )" %node )
    239234
     235        def addJobNodes( self, jobid, nodes ):
     236
     237                for node in nodes:
     238                        self.addJobNode( jobid, node )
     239
    240240        def addJobNode( self, jobid, nodeid ):
    241241
     
    379379                        self.myXMLSource = self.myXMLGatherer.getFileObject()
    380380                        xml.sax.parse( self.myXMLSource, self.myXMLHandler, self.myXMLError )
    381                         print self.myXMLHandler.jobAttrs
    382381                        print 'sleep'
    383382                        time.sleep( 1 )
     
    432431                                                if valname == 'nodes':
    433432                                                        value = value.split( ';' )
    434                                                         self.ds.addNodes( value )
    435433
    436434                                                jobinfo[ valname ] = value
Note: See TracChangeset for help on using the changeset viewer.