From dcb15dc1e6bda61611f7fd32c1e064fb85951d42 Mon Sep 17 00:00:00 2001 From: Timothy Asir Jeyasingh Date: Tue, 24 Jun 2014 14:36:50 +0530 Subject: Fix pep8 errors Change-Id: I0d41725a02636228bc613b40c1b4d2d57a35e3e3 Signed-off-by: Timothy Asir Jeyasingh Reviewed-on: http://review.gluster.org/8159 Tested-by: Timothy Asir Reviewed-by: Shubhendu Tripathi --- plugins/check_gluster_syslog.py | 4 ++-- plugins/check_vol_utilization.py | 16 ++++++++-------- plugins/discover_volumes.py | 2 +- plugins/discoverhostparams.py | 10 +++++----- tests/check_proc_test_data.py | 2 +- tests/testValidation.py | 2 +- tests/testrunner.py | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/plugins/check_gluster_syslog.py b/plugins/check_gluster_syslog.py index d83e302..2f6d201 100755 --- a/plugins/check_gluster_syslog.py +++ b/plugins/check_gluster_syslog.py @@ -55,13 +55,13 @@ def processQuotaMsg(msg, alertlevel): def processQuorumMsg(msgid, msg, level): logger = logging.getLogger("processQuorumMsg") pluginstatus = None - #if msgid == 106002: + # if msgid == 106002: if "[MSGID: 106002]" in msg or "[MSGID: 106001]" in msg: # [MSGID: 106002] Server quorum lost for volume dist. # Stopping local bricks. # [MSGID: 106001] Server quorum not met. Rejecting operation. pluginstatus = utils.PluginStatusCode.CRITICAL - #elif msgid == 106003: + # elif msgid == 106003: elif "[MSGID: 106003]" in msg: # [MSGID: 106003] Server quorum regained for volume dist. # Starting local bricks. diff --git a/plugins/check_vol_utilization.py b/plugins/check_vol_utilization.py index 8500df0..2593ca7 100755 --- a/plugins/check_vol_utilization.py +++ b/plugins/check_vol_utilization.py @@ -33,16 +33,16 @@ def showVolumeUtilization(vname, warnLevel, critLevel): "Volume Utilization Data\n") sys.exit(utils.PluginStatusCode.UNKNOWN) #################################################################### -#statvfs.frsize * statvfs.f_blocks# Size of filesystem in bytes # -#statvfs.frsize * statvfs.f_bfree # Actual number of free bytes # -#statvfs.frsize * statvfs.f_bavail# Number of free bytes that # -#ordinary users are allowed to use (excl. reserved space # +# statvfs.frsize * statvfs.f_blocks# Size of filesystem in bytes # +# statvfs.frsize * statvfs.f_bfree # Actual number of free bytes # +# statvfs.frsize * statvfs.f_bavail# Number of free bytes that # +# ordinary users are allowed to use (excl. reserved space # #################################################################### - #total size in KB + # total size in KB total_size = (buf['f_bsize'] * buf['f_blocks']) / 1024.0 - #Available free size in KB + # Available free size in KB free_size = (buf['f_bsize'] * buf['f_bavail']) / 1024.0 - #used size in KB + # used size in KB used_size = total_size - ((buf['f_bsize'] * buf['f_bfree']) / 1024.0) vol_utilization = (used_size / total_size) * 100 perfLines = [] @@ -110,6 +110,6 @@ def parse_input(): if __name__ == '__main__': args = parse_input() - #check the volume status before getting the volume utilization + # check the volume status before getting the volume utilization check_volume_status(args.volume) showVolumeUtilization(args.volume, args.warning, args.critical) diff --git a/plugins/discover_volumes.py b/plugins/discover_volumes.py index 5d1d463..53d17a8 100755 --- a/plugins/discover_volumes.py +++ b/plugins/discover_volumes.py @@ -1,6 +1,6 @@ #!/usr/bin/python # discover_volumes.py -- nagios plugin for discovering -#logical gluster components +# logical gluster components # Copyright (C) 2014 Red Hat Inc # # This program is free software; you can redistribute it and/or diff --git a/plugins/discoverhostparams.py b/plugins/discoverhostparams.py index 9722dcf..69ddd5b 100755 --- a/plugins/discoverhostparams.py +++ b/plugins/discoverhostparams.py @@ -36,11 +36,11 @@ def discoverhostparams(): ### -#This plugin discovers all the host specific parameters -#Currently it gets only the hostname from the node -#but when we add support for discovering physical -#components like cpu,network,disk etc, all those will be -#addded as part of this module +# This plugin discovers all the host specific parameters +# Currently it gets only the hostname from the node +# but when we add support for discovering physical +# components like cpu,network,disk etc, all those will be +# addded as part of this module ### if __name__ == '__main__': discoverhostparams() diff --git a/tests/check_proc_test_data.py b/tests/check_proc_test_data.py index 6fa8a7f..2c59cfa 100644 --- a/tests/check_proc_test_data.py +++ b/tests/check_proc_test_data.py @@ -93,7 +93,7 @@ nfsEnabled2 = {'rep1': {'brickCount': '2', 'volumeStatus': 'ONLINE', 'volumeType': 'REPLICATE'}} -#NFS enabled using set option +# NFS enabled using set option nfsEnabled3 = {'vol1': {'brickCount': '3', 'bricks': ['10.70.43.33:/bricks/b1', '10.70.43.33:/bricks/my-vol1-b2.new', diff --git a/tests/testValidation.py b/tests/testValidation.py index b46c9f8..e9d6677 100644 --- a/tests/testValidation.py +++ b/tests/testValidation.py @@ -18,7 +18,7 @@ # Refer to the README and COPYING files for full details of the license # -## This framework is mostly copied from vdsm test framework +# This framework is mostly copied from vdsm test framework import os from nose.plugins.skip import SkipTest diff --git a/tests/testrunner.py b/tests/testrunner.py index 1ee7e35..97aedaf 100644 --- a/tests/testrunner.py +++ b/tests/testrunner.py @@ -18,7 +18,7 @@ # Refer to the README and COPYING files for full details of the license # -## This framework is mostly copied from vdsm test framework +# This framework is mostly copied from vdsm test framework import logging import sys -- cgit