Changeset 41
- Timestamp:
- 04/05/05 12:29:35 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/daemon/togad.py
r40 r41 95 95 for line in os.popen( self.binary + ' ' + action + ' ' + filename + ' ' + arg_string ).readlines(): 96 96 97 print line98 99 97 if line.find( 'ERROR' ) != -1: 100 98 … … 515 513 516 514 update_list = [ ] 515 metric = None 517 516 518 517 while len( self.myMetrics[ host ][ metricname ] ) > 0: … … 523 522 self.slot.acquire() 524 523 525 metric = self.myMetrics[ host ][ metricname ].pop() 524 # len might have changed since loop start 525 # 526 if len( self.myMetrics[ host ][ metricname ] ) > 0: 527 metric = self.myMetrics[ host ][ metricname ].pop() 526 528 527 529 self.slot.release() 528 530 # </atomic> 529 531 530 if self.checkStoreMetric( host, metricname, metric ): 531 update_list.append( '%s:%s' %( metric['time'], metric['val'] ) ) 532 else: 533 print 'allready wrote metric %s with timestamp %s' %( metric['name'], metric['time'] ) 532 if metric: 533 if self.checkStoreMetric( host, metricname, metric ): 534 update_list.append( '%s:%s' %( metric['time'], metric['val'] ) ) 535 else: 536 print 'allready wrote metric %s with timestamp %s' %( metric['name'], metric['time'] ) 534 537 535 538 return update_list … … 569 572 else: 570 573 debug_msg( 9, 'metric update failed' ) 571 return 1572 573 return 1574 574 575 575 def makeTimeSerial( self ): … … 707 707 update_list = self.makeUpdateList( host, metricname ) 708 708 709 ret = self.rrdm.update( str(rrd_file), update_list ) 710 711 if ret: 712 return 1 709 if len( update_list ) > 0: 710 ret = self.rrdm.update( str(rrd_file), update_list ) 711 712 if ret: 713 return 1 713 714 714 debug_msg( 9, 'updated rrd %s with %s' %( str(rrd_file), string.join( update_list ) ) )715 debug_msg( 9, 'updated rrd %s with %s' %( str(rrd_file), string.join( update_list ) ) ) 715 716 716 717 return 0
Note: See TracChangeset
for help on using the changeset viewer.