Changeset 69 for trunk


Ignore:
Timestamp:
04/14/05 15:51:10 (19 years ago)
Author:
bastiaans
Message:

plugin/togap.py:

  • Misc bugfixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugin/togap.py

    r68 r69  
    33# Specify debugging level here;
    44#
    5 DEBUG_LEVEL = 10
     5DEBUG_LEVEL = 0
    66
    77# Wether or not to run as a daemon in background
     
    5252                        sys.exit( 1 )
    5353
    54                 #incompatible = self.checkGmetricVersion()
    55                 incompatible = 0
     54                incompatible = self.checkGmetricVersion()
    5655
    5756                if incompatible:
     
    6968                        line = line.split( ' ' )
    7069
    71                         if len( line ) == 2 and line.find( 'gmetric' ) != -1:
     70                        if len( line ) == 2 and str(line).find( 'gmetric' ) != -1:
    7271                       
    73                                 gmetric_version = line[1]
    74 
    75                                 version_major = int( gemtric_version.split( '.' )[0] )
    76                                 version_minor = int( gemtric_version.split( '.' )[1] )
    77                                 version_patch = int( gemtric_version.split( '.' )[2] )
     72                                gmetric_version = line[1].split( '\n' )[0]
     73
     74                                version_major = int( gmetric_version.split( '.' )[0] )
     75                                version_minor = int( gmetric_version.split( '.' )[1] )
     76                                version_patch = int( gmetric_version.split( '.' )[2] )
    7877
    7978                                incompatible = 0
     
    106105
    107106                print cmd
    108                 #os.system( cmd )
     107                os.system( cmd )
    109108
    110109class PBSDataGatherer:
     
    158157                joblist = self.pq.getjobs()
    159158
    160                 cur_time = time.time()
     159                self.cur_time = time.time()
    161160
    162161                jobs_processed = [ ]
    163162
    164163                for name, attrs in joblist.items():
    165 
    166                         print attrs
    167164
    168165                        job_id = name.split( '.' )[0]
     
    201198                        myAttrs['status'] = status
    202199                        myAttrs['start_timestamp'] = start_timestamp
    203                         myAttrs['reported_timestamp'] = str( int( cur_time ) )
     200                        myAttrs['reported_timestamp'] = str( int( self.cur_time ) )
    204201                        myAttrs['nodes'] = nodeslist
    205202                        myAttrs['domain'] = string.join( socket.getfqdn().split( '.' )[1:], '.' )
     
    208205                                jobs[ job_id ] = myAttrs
    209206
    210                                 self.printJob( jobs, job_id )
     207                                #self.printJob( jobs, job_id )
    211208
    212209                                debug_msg( 10, printTime() + ' job %s state changed' %(job_id) )
     
    216213        def submitJobData( self, jobs ):
    217214                """Submit job info list"""
     215
     216                self.dp.multicastGmetric( 'TOGA-HEARTBEAT', str( int( self.cur_time ) ) )
    218217
    219218                # Now let's spread the knowledge
     
    287286                """Check if val + text size is not above 1400 (max msg size)"""
    288287
     288                # Max frame size of a udp datagram is 1500 bytes
     289                # removing misc header and gmetric stuff leaves about 1400 bytes
     290                #
    289291                if len( val + text ) > 1400:
    290292                        return 1
Note: See TracChangeset for help on using the changeset viewer.