summaryrefslogtreecommitdiffstats
path: root/tests/test_discover_volumes.py
diff options
context:
space:
mode:
authorNishanth Thomas <nthomas@redhat.com>2014-11-07 00:54:13 +0530
committerSahina Bose <sabose@redhat.com>2014-11-17 21:39:56 -0800
commitabb72c79f7f2906195c0b7e33d3ad198dd372aec (patch)
treebc10679f1a6ce46c28b3a90a51d817c981386e49 /tests/test_discover_volumes.py
parent40a0f0670b126897f5a98445ed51669b9dc88ec6 (diff)
gluster-nagios-addons:discover_volumes to return proper error in case of exception
discoverVolumes was not returning the error message in case of exception while retrieving the data from the backend. Due this the calling funtions always expect a list and causing inconsistent results https://bugzilla.redhat.com/show_bug.cgi?id=1136205 https://bugzilla.redhat.com/show_bug.cgi?id=1109843 Signed-off-by: Nishanth Thomas <nthomas@redhat.com> Change-Id: I518a5f94fd5d414028970379e268e0aa8a408285 Reviewed-on: http://review.gluster.org/9065 Reviewed-by: Shubhendu Tripathi <shtripat@redhat.com> Tested-by: Nishanth Thomas <nishusemail@gmail.com> Reviewed-by: Sahina Bose <sabose@redhat.com>
Diffstat (limited to 'tests/test_discover_volumes.py')
-rw-r--r--tests/test_discover_volumes.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_discover_volumes.py b/tests/test_discover_volumes.py
index 626f2e3..e5d15b7 100644
--- a/tests/test_discover_volumes.py
+++ b/tests/test_discover_volumes.py
@@ -77,12 +77,14 @@ class TestDiscoverVolumes(TestCaseBase):
def testDiscoverVolumesList(self):
discover_volumes.glustercli.volumeInfo = self._mockGetVolumeInfo
- volumesList = json.loads(discover_volumes.discoverVolumes(None, True))
+ status, output = discover_volumes.discoverVolumes(None, True)
+ volumesList = json.loads(output)
self._verifyVolumeList(volumesList)
def testDiscoverVolumesInfo(self):
discover_volumes.glustercli.volumeInfo = self._mockGetVolumeInfo
- volumesList = json.loads(discover_volumes.discoverVolumes("V1", False))
+ status, output = discover_volumes.discoverVolumes("V1", False)
+ volumesList = json.loads(output)
self._verifyVolumeInfo(volumesList, "V1")
def testAruguments(self):