From 63f7ffadb466d914bd67d74bbde495e75367cfdb Mon Sep 17 00:00:00 2001 From: n darshan Date: Mon, 5 May 2014 00:47:54 -0400 Subject: gluster-nagios-common: PEP8 fixes. fixed pep8 issues in glusternagios/glustercli.py tests/test_glustercli.py Change-Id: Iea9d12543f854dca322f774f3fc255d0716107ff Signed-off-by: n darshan Reviewed-on: http://review.gluster.org/7670 Reviewed-by: Sahina Bose --- glusternagios/glustercli.py | 12 ++++++------ tests/test_glustercli.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/glusternagios/glustercli.py b/glusternagios/glustercli.py index 1304611..c424438 100755 --- a/glusternagios/glustercli.py +++ b/glusternagios/glustercli.py @@ -413,8 +413,8 @@ def _parseVolumeInfo(tree): value['options'][o.find('name').text] = o.find('value').text for d in el.findall('bricks/brick'): brickDetail = {} - #this try block is to maintain backward compatibility - #it returns an empty list when gluster doesnot return uuid + # this try block is to maintain backward compatibility + # it returns an empty list when gluster doesnot return uuid try: brickDetail['name'] = d.find('name').text brickDetail['hostUuid'] = d.find('hostUuid').text @@ -454,11 +454,11 @@ def volumeInfo(volumeName=None, remoteServer=None): def _parseVolumeQuotaStatus(out, isDisabled=False): status_detail = {'status': VolumeQuotaStatus.OK, - 'soft_ex_dirs': [], - 'hard_ex_dirs': []} + 'soft_ex_dirs': [], + 'hard_ex_dirs': []} - if isDisabled or out[0].startswith( - 'quota: No quota') or out[0].find('not enabled') > -1: + if isDisabled or out[0].startswith('quota: No quota' + ) or out[0].find('not enabled') > -1: status_detail['status'] = VolumeQuotaStatus.DISABLED return status_detail for line in out[2:]: diff --git a/tests/test_glustercli.py b/tests/test_glustercli.py index 78c9170..ebaeac4 100644 --- a/tests/test_glustercli.py +++ b/tests/test_glustercli.py @@ -1074,8 +1074,8 @@ class GlusterCliTests(TestCaseBase): "volume demo-test-vol"], None status = gcli.volumeQuotaStatus("test-vol") exp_disabled_out = {'status': gcli.VolumeQuotaStatus.DISABLED, - 'hard_ex_dirs': [], - 'soft_ex_dirs': []} + 'hard_ex_dirs': [], + 'soft_ex_dirs': []} self.assertEquals(status, exp_disabled_out) mock_execCmd.return_value = 0, ["quota: No quota " "configured on " -- cgit