Changeset 82


Ignore:
Timestamp:
04/18/05 10:54:35 (19 years ago)
Author:
bastiaans
Message:

daemon/togad.py:

  • New jobinfo will now be appended to existing info, without losing old info because info can be spread out among misc. metric's for the same job
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/togad.py

    r81 r82  
    270270                                if check_change:
    271271                                        if self.jobinfoChanged( self.jobAttrs, job_id, jobinfo ):
    272                                                 self.jobAttrs[ job_id ] = jobinfo
     272                                                self.jobAttrs[ job_id ] = self.setJobAttrs( self.jobAttrs[ job_id ], jobinfo )
    273273                                                debug_msg( 0, 'jobinfo for job %s has changed' %job_id )
    274274                                else:
     
    289289                                self.jobAttrs[ jobid ]['stop_timestamp'] = str( int( jobinfo['reported'] ) + int( jobinfo['poll_interval'] ) )
    290290
     291        def setJobAttrs( self, old, new ):
     292                """
     293                Set new job attributes in old, but not lose existing fields
     294                if old attributes doesn't have those
     295                """
     296
     297                for valname, value in new.items():
     298                        old[ valname ] = value
     299
     300                return old
     301               
     302
    291303        def jobinfoChanged( self, jobattrs, jobid, jobinfo ):
    292304                """
Note: See TracChangeset for help on using the changeset viewer.