Changeset 72


Ignore:
Timestamp:
04/15/05 11:17:54 (19 years ago)
Author:
bastiaans
Message:

daemon/togad.py:

  • Jobinfo XML parsing now working (into memory)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/togad.py

    r71 r72  
    157157        """Parse Torque's jobinfo XML from our plugin"""
    158158
     159        jobAttrs = { }
     160
    159161        def __init__( self ):
    160162
     
    179181                        elif metricname.find( 'TOGA-JOB' ) != -1:
    180182
    181                                 job_id = name.split( 'TOGA-JOB-' )[1]
     183                                job_id = metricname.split( 'TOGA-JOB-' )[1]
    182184                                val = attrs.get( 'VAL', "" )
    183185
     
    187189                                for myval in valinfo:
    188190
    189                                         name = valinfo.split( '=' )[0]
    190                                         value = valinfo.split( '=' )[1]
    191 
    192                                         #if name == '
     191                                        valname = myval.split( '=' )[0]
     192                                        value = myval.split( '=' )[1]
     193
     194                                        if valname == 'nodes':
     195                                                value = value.split( ';' )
     196
     197                                        if not self.jobAttrs.has_key( job_id ):
     198                                                self.jobAttrs[ job_id ] = { }
     199
     200                                        self.jobAttrs[ job_id ][ valname ] = value
     201
     202                print self.jobAttrs
    193203
    194204class GangliaXMLHandler( xml.sax.handler.ContentHandler ):
Note: See TracChangeset for help on using the changeset viewer.