summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Asir Jeyasingh <tjeyasin@redhat.com>2014-06-24 14:36:50 +0530
committerSahina Bose <sabose@redhat.com>2014-06-26 01:55:11 -0700
commitdcb15dc1e6bda61611f7fd32c1e064fb85951d42 (patch)
treef81737b65578856c91f53251f35d4750e388a2db
parent6af042189cb95932b7f4aafc37a9227f47626433 (diff)
Fix pep8 errorsv0.1.1
Change-Id: I0d41725a02636228bc613b40c1b4d2d57a35e3e3 Signed-off-by: Timothy Asir Jeyasingh <tjeyasin@redhat.com> Reviewed-on: http://review.gluster.org/8159 Tested-by: Timothy Asir <tim.gluster@gmail.com> Reviewed-by: Shubhendu Tripathi <shtripat@redhat.com>
-rwxr-xr-xplugins/check_gluster_syslog.py4
-rwxr-xr-xplugins/check_vol_utilization.py16
-rwxr-xr-xplugins/discover_volumes.py2
-rwxr-xr-xplugins/discoverhostparams.py10
-rw-r--r--tests/check_proc_test_data.py2
-rw-r--r--tests/testValidation.py2
-rw-r--r--tests/testrunner.py2
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