summaryrefslogtreecommitdiffstats
path: root/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
diff options
context:
space:
mode:
authorvamahaja <vamahaja@redhat.com>2019-09-13 10:41:41 +0530
committervamahaja <vamahaja@redhat.com>2019-09-13 15:58:57 +0530
commit9f1d09bbcb1d3aacfae0e42c281e84ab4f04534e (patch)
tree99b762dd8a085e34e8fcdb10f976ca35d20e7553 /openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
parentff7b40a09c4029a0a59b6fb96bbe9dc2a19e88e2 (diff)
Fix get gluster pod library for independent cluster
"get_ocp_gluster_pod_details" library gives error "IndexError: list index out of range" in case of independent mode setup as "get_custom_resource" returns "[[]]" which in not none. Added fix to check if any element present in list. Change-Id: Iffd081f835ffaf9cb50c020cd297444ea2678950 Signed-off-by: vamahaja <vamahaja@redhat.com>
Diffstat (limited to 'openshift-storage-libs/openshiftstoragelibs/openshift_ops.py')
-rw-r--r--openshift-storage-libs/openshiftstoragelibs/openshift_ops.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py b/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
index 87e5580..0816785 100644
--- a/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
+++ b/openshift-storage-libs/openshiftstoragelibs/openshift_ops.py
@@ -124,6 +124,9 @@ def get_ocp_gluster_pod_details(ocp_node):
gluster_pods = oc_get_custom_resource(
ocp_node, "pod", pod_columns, selector=pod_selector)
+ if not gluster_pods[0]:
+ return []
+
gluster_pod_details = map(
lambda pod: {
"pod_name": pod[0],