Changeset 355 for trunk/jobmond
- Timestamp:
- 05/03/07 15:09:25 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jobmond/jobmond.py
r354 r355 200 200 201 201 class DataProcessor: 202 202 203 """Class for processing of data""" 203 204 … … 205 206 206 207 def __init__( self, binary=None ): 208 207 209 """Remember alternate binary location if supplied""" 208 210 … … 234 236 235 237 if incompatible: 236 debug_msg( 0, 'Gmetric version not compatible, pls upgrade to at least 3.0.1' ) 238 239 debug_msg( 0, 'Gmetric version not compatible, please upgrade to at least 3.0.1' ) 237 240 sys.exit( 1 ) 238 241 239 242 def checkGmetricVersion( self ): 243 240 244 """ 241 245 Check version of gmetric is at least 3.0.1 … … 247 251 incompatible = 0 248 252 249 for line in os.popen( self.binary + ' --version' ).readlines(): 253 gfp = os.popen( self.binary + ' --version' ) 254 lines = gfp.readlines() 255 256 gfp.close() 257 258 for line in lines: 250 259 251 260 line = line.split( ' ' ) 252 261 253 if len( line ) == 2 and str( line).find( 'gmetric' ) != -1:262 if len( line ) == 2 and str( line ).find( 'gmetric' ) != -1: 254 263 255 gmetric_version 256 257 version_major 258 version_minor 259 version_patch 260 261 incompatible 264 gmetric_version = line[1].split( '\n' )[0] 265 266 version_major = int( gmetric_version.split( '.' )[0] ) 267 version_minor = int( gmetric_version.split( '.' )[1] ) 268 version_patch = int( gmetric_version.split( '.' )[2] ) 269 270 incompatible = 0 262 271 263 272 if version_major < 3: … … 284 293 285 294 def multicastGmetric( self, metricname, metricval, valtype='string' ): 295 286 296 """Call gmetric binary and multicast""" 287 297 … … 324 334 325 335 def printJobs( self, jobs ): 336 326 337 """Print a jobinfo overview""" 327 338 … … 335 346 336 347 def printJob( self, jobs, job_id ): 348 337 349 """Print job with job_id from jobs""" 338 350 … … 344 356 345 357 def daemon( self ): 358 346 359 """Run as daemon forever""" 347 360 … … 380 393 381 394 def run( self ): 395 382 396 """Main thread""" 383 397 … … 507 521 self.dp.multicastGmetric( 'MONARCH-JOB-' + jobid + '-' + str(metric_increment), jobattrs) 508 522 509 class PbsDataGatherer( DataGatherer):523 class PbsDataGatherer( DataGatherer ): 510 524 511 525 """This is the DataGatherer for PBS and Torque"""
Note: See TracChangeset
for help on using the changeset viewer.