From c10f470d886b1822d7f4c44cb42dd4360e044e09 Mon Sep 17 00:00:00 2001 From: carenas Date: Tue, 15 Mar 2011 08:51:23 +0000 Subject: [PATCH] python_modules: tcpconn reduce scope of test loop --- .../gmond/python_modules/network/tcpconn.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/monitor-core/gmond/python_modules/network/tcpconn.py b/monitor-core/gmond/python_modules/network/tcpconn.py index 846ea3769..db3f7dece 100644 --- a/monitor-core/gmond/python_modules/network/tcpconn.py +++ b/monitor-core/gmond/python_modules/network/tcpconn.py @@ -1,4 +1,4 @@ -#/******************************************************************************* +#******************************************************************************* #* Portions Copyright (C) 2007 Novell, Inc. All rights reserved. #* #* Redistribution and use in source and binary forms, with or without @@ -59,7 +59,7 @@ def TCP_Connections(name): global _WorkerThread if _WorkerThread is None: - print 'Error: No netstat data gathering thread created for metric %s'%name + print 'Error: No netstat data gathering thread created for metric %s' % name return 0; if not _WorkerThread.running and not _WorkerThread.shuttingdown: @@ -334,13 +334,13 @@ def metric_cleanup(): #This code is for debugging and unit testing if __name__ == '__main__': - try: - params = {'Refresh': '20'} - metric_init(params) - while True: + params = {'Refresh': '20'} + metric_init(params) + while True: + try: for d in _descriptors: v = d['call_back'](d['name']) print 'value for %s is %u' % (d['name'], v) time.sleep(5) - except KeyboardInterrupt: - os._exit(1) + except KeyboardInterrupt: + os._exit(1)