From 1ee32cb06834ebb80d548ef4039b9e40f928900e Mon Sep 17 00:00:00 2001 From: Timothy Asir Jeyasingh Date: Tue, 24 Jun 2014 14:44:55 +0530 Subject: fix pep8 errors Change-Id: I3121e6b4044e2f0831fe3c862fb12e8bc27cfd3c Signed-off-by: Timothy Asir Jeyasingh Reviewed-on: http://review.gluster.org/8160 Tested-by: Timothy Asir Reviewed-by: Sahina Bose --- glusternagios/storage.py | 8 +-- glusternagios/utils.py | 2 +- tests/testValidation.py | 2 +- tests/test_storage.py | 128 +++++++++++++++++++++++------------------------ tests/testrunner.py | 2 +- tests/utilsTests.py | 2 +- 6 files changed, 72 insertions(+), 72 deletions(-) diff --git a/glusternagios/storage.py b/glusternagios/storage.py index 1147d25..ff6b108 100755 --- a/glusternagios/storage.py +++ b/glusternagios/storage.py @@ -268,16 +268,16 @@ def getDisksForBrick(deviceName=None, brickName=None): return "" -#gets the brick's device name using df command +# gets the brick's device name using df command def getBrickDeviceName(brickName): brickName = brickName.rstrip() if brickName is "": return "" dfOut = getdf(brickName) - #The output will be similar to - #['Filesystem Size Used Avail Use% Mounted on', + # The output will be similar to + # ['Filesystem Size Used Avail Use% Mounted on', # '/dev/vda1 485M 34M 426M 8% /boot'] - #need to parse to get the device name + # need to parse to get the device name if len(dfOut) > 1: dfOutList = dfOut[1].split() if len(dfOutList) > 0: diff --git a/glusternagios/utils.py b/glusternagios/utils.py index 88ebccf..3882a63 100644 --- a/glusternagios/utils.py +++ b/glusternagios/utils.py @@ -18,7 +18,7 @@ # Refer to the README and COPYING files for full details of the license # -## most of the code is copied from vdsm project +# most of the code is copied from vdsm project import logging import subprocess 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/test_storage.py b/tests/test_storage.py index 504c939..75f3ab9 100644 --- a/tests/test_storage.py +++ b/tests/test_storage.py @@ -98,71 +98,71 @@ class TestStorageUtils(TestCaseBase): "lv_all,vg_name").split() ret_val = glusternagios.storage.getLvs() value_to_verify = {'/dev/vg_shubhnd/lv_root': - {'LVM2_SYNC_PERCENT': '', - 'LVM2_LV_METADATA_SIZE': '', - 'LVM2_LV_ATTR': '-wi-ao---', - 'LVM2_MIRROR_LOG': '', - 'LVM2_LV_KERNEL_MINOR': '0', - 'LVM2_LV_SIZE': '46728.00', - 'LVM2_LV_MAJOR': '-1', - 'LVM2_ORIGIN_SIZE': '0', - 'LVM2_LV_TIME': '2014-03-14 04:27:56 +0530', - 'LVM2_METADATA_PERCENT': '', - 'LVM2_POOL_LV': '', - 'LVM2_COPY_PERCENT': '', - 'LVM2_CONVERT_LV': '', - 'LVM2_LV_KERNEL_READ_AHEAD': '0.12', - 'LVM2_LV_NAME': 'lv_root', - 'LVM2_LV_HOST': 'shubh-nd.redhat.com', - 'LVM2_LV_UUID': - 'zjuuHG-HajL-PXxm-fjlL-5i00-EUnV-Wd2qL3', - 'LVM2_LV_MINOR': '-1', - 'LVM2_DATA_PERCENT': '', - 'LVM2_LV_KERNEL_MAJOR': '253', - 'LVM2_LV_TAGS': '', - 'LVM2_MODULES': '', - 'LVM2_VG_NAME': 'vg_shubhnd', - 'LVM2_METADATA_LV': '', - 'LVM2_LV_PATH': '/dev/vg_shubhnd/lv_root', - 'LVM2_DATA_LV': '', - 'LVM2_LV_READ_AHEAD': 'auto', - 'LVM2_SNAP_PERCENT': '', - 'LVM2_MOVE_PV': '', - 'LVM2_ORIGIN': '', - 'LVM2_SEG_COUNT': '1'}, + {'LVM2_SYNC_PERCENT': '', + 'LVM2_LV_METADATA_SIZE': '', + 'LVM2_LV_ATTR': '-wi-ao---', + 'LVM2_MIRROR_LOG': '', + 'LVM2_LV_KERNEL_MINOR': '0', + 'LVM2_LV_SIZE': '46728.00', + 'LVM2_LV_MAJOR': '-1', + 'LVM2_ORIGIN_SIZE': '0', + 'LVM2_LV_TIME': '2014-03-14 04:27:56 +0530', + 'LVM2_METADATA_PERCENT': '', + 'LVM2_POOL_LV': '', + 'LVM2_COPY_PERCENT': '', + 'LVM2_CONVERT_LV': '', + 'LVM2_LV_KERNEL_READ_AHEAD': '0.12', + 'LVM2_LV_NAME': 'lv_root', + 'LVM2_LV_HOST': 'shubh-nd.redhat.com', + 'LVM2_LV_UUID': + 'zjuuHG-HajL-PXxm-fjlL-5i00-EUnV-Wd2qL3', + 'LVM2_LV_MINOR': '-1', + 'LVM2_DATA_PERCENT': '', + 'LVM2_LV_KERNEL_MAJOR': '253', + 'LVM2_LV_TAGS': '', + 'LVM2_MODULES': '', + 'LVM2_VG_NAME': 'vg_shubhnd', + 'LVM2_METADATA_LV': '', + 'LVM2_LV_PATH': '/dev/vg_shubhnd/lv_root', + 'LVM2_DATA_LV': '', + 'LVM2_LV_READ_AHEAD': 'auto', + 'LVM2_SNAP_PERCENT': '', + 'LVM2_MOVE_PV': '', + 'LVM2_ORIGIN': '', + 'LVM2_SEG_COUNT': '1'}, '/dev/vg_shubhnd/lv_swap': - {'LVM2_SYNC_PERCENT': '', - 'LVM2_LV_METADATA_SIZE': '', - 'LVM2_LV_ATTR': '-wi-ao---', - 'LVM2_MIRROR_LOG': '', - 'LVM2_LV_KERNEL_MINOR': '1', - 'LVM2_LV_SIZE': '3968.00', - 'LVM2_LV_MAJOR': '-1', - 'LVM2_ORIGIN_SIZE': '0', - 'LVM2_LV_TIME': '2014-03-14 04:28:01 +0530', - 'LVM2_METADATA_PERCENT': '', - 'LVM2_POOL_LV': '', - 'LVM2_COPY_PERCENT': '', - 'LVM2_CONVERT_LV': '', - 'LVM2_LV_KERNEL_READ_AHEAD': '0.12', - 'LVM2_LV_NAME': 'lv_swap', - 'LVM2_LV_HOST': 'shubh-nd.redhat.com', - 'LVM2_LV_UUID': - 'klTthp-BXN8-9loo-UUo9-Y2lB-6azb-X9fFdH', - 'LVM2_LV_MINOR': '-1', - 'LVM2_DATA_PERCENT': '', - 'LVM2_LV_KERNEL_MAJOR': '253', - 'LVM2_LV_TAGS': '', - 'LVM2_MODULES': '', - 'LVM2_VG_NAME': 'vg_shubhnd', - 'LVM2_METADATA_LV': '', - 'LVM2_LV_PATH': '/dev/vg_shubhnd/lv_swap', - 'LVM2_DATA_LV': '', - 'LVM2_LV_READ_AHEAD': 'auto', - 'LVM2_SNAP_PERCENT': '', - 'LVM2_MOVE_PV': '', - 'LVM2_ORIGIN': '', - 'LVM2_SEG_COUNT': '1'}} + {'LVM2_SYNC_PERCENT': '', + 'LVM2_LV_METADATA_SIZE': '', + 'LVM2_LV_ATTR': '-wi-ao---', + 'LVM2_MIRROR_LOG': '', + 'LVM2_LV_KERNEL_MINOR': '1', + 'LVM2_LV_SIZE': '3968.00', + 'LVM2_LV_MAJOR': '-1', + 'LVM2_ORIGIN_SIZE': '0', + 'LVM2_LV_TIME': '2014-03-14 04:28:01 +0530', + 'LVM2_METADATA_PERCENT': '', + 'LVM2_POOL_LV': '', + 'LVM2_COPY_PERCENT': '', + 'LVM2_CONVERT_LV': '', + 'LVM2_LV_KERNEL_READ_AHEAD': '0.12', + 'LVM2_LV_NAME': 'lv_swap', + 'LVM2_LV_HOST': 'shubh-nd.redhat.com', + 'LVM2_LV_UUID': + 'klTthp-BXN8-9loo-UUo9-Y2lB-6azb-X9fFdH', + 'LVM2_LV_MINOR': '-1', + 'LVM2_DATA_PERCENT': '', + 'LVM2_LV_KERNEL_MAJOR': '253', + 'LVM2_LV_TAGS': '', + 'LVM2_MODULES': '', + 'LVM2_VG_NAME': 'vg_shubhnd', + 'LVM2_METADATA_LV': '', + 'LVM2_LV_PATH': '/dev/vg_shubhnd/lv_swap', + 'LVM2_DATA_LV': '', + 'LVM2_LV_READ_AHEAD': 'auto', + 'LVM2_SNAP_PERCENT': '', + 'LVM2_MOVE_PV': '', + 'LVM2_ORIGIN': '', + 'LVM2_SEG_COUNT': '1'}} self.assertEquals(ret_val, value_to_verify) @mock.patch('glusternagios.storage._getVgsCmd') diff --git a/tests/testrunner.py b/tests/testrunner.py index 56f1416..16b9685 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 diff --git a/tests/utilsTests.py b/tests/utilsTests.py index fdf1ec3..49fa33f 100644 --- a/tests/utilsTests.py +++ b/tests/utilsTests.py @@ -41,7 +41,7 @@ class RetryTests(TestCaseBase): raise RuntimeError("If at first you don't succeed, try, try again." "Then quit. There's no point in being a damn" "fool about it.") - # W. C. Fields + # W. C. Fields self.assertRaises(RuntimeError, utils.retry, foo, tries=(limit + 10), sleep=0, stopCallback=stopCallback) -- cgit