summaryrefslogtreecommitdiffstats
path: root/openshift-storage-libs/openshiftstoragelibs/baseclass.py
diff options
context:
space:
mode:
authorvamahaja <vamahaja@redhat.com>2019-09-13 13:24:34 +0530
committervponomar <vponomar@redhat.com>2019-09-13 11:51:10 +0000
commit610c21c8a73329a13167f47bf6de0cf66e57cd05 (patch)
treef841c0cf1c91e1498e49ea484e935cb2457a66dc /openshift-storage-libs/openshiftstoragelibs/baseclass.py
parent9f1d09bbcb1d3aacfae0e42c281e84ab4f04534e (diff)
Fix self.node issue in GlusterBlockBaseClass class
Gluster block test cases failed with error "self.node" variable not found as self.node variable is not created in "GlusterStabilityTestSetup" class. Fixed change in baseclass.py by using variable "self.ocp_client[0]". Change-Id: I2affabbb626b7e266a9bb243d3ec249229ec9670 Signed-off-by: vamahaja <vamahaja@redhat.com>
Diffstat (limited to 'openshift-storage-libs/openshiftstoragelibs/baseclass.py')
-rw-r--r--openshift-storage-libs/openshiftstoragelibs/baseclass.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/openshift-storage-libs/openshiftstoragelibs/baseclass.py b/openshift-storage-libs/openshiftstoragelibs/baseclass.py
index 19668b1..554863e 100644
--- a/openshift-storage-libs/openshiftstoragelibs/baseclass.py
+++ b/openshift-storage-libs/openshiftstoragelibs/baseclass.py
@@ -383,18 +383,19 @@ class GlusterBlockBaseClass(BaseClass):
gluster_ips.sort()
# Find iqn and hacount from volume info
- pv_name = get_pv_name_from_pvc(self.node, pvc_name)
+ pv_name = get_pv_name_from_pvc(self.ocp_client[0], pvc_name)
custom = [r':.metadata.annotations."gluster\.org\/volume\-id"']
- vol_id = oc_get_custom_resource(self.node, 'pv', custom, pv_name)[0]
+ vol_id = oc_get_custom_resource(
+ self.ocp_client[0], 'pv', custom, pv_name)[0]
vol_info = heketi_blockvolume_info(
self.heketi_client_node, self.heketi_server_url, vol_id, json=True)
iqn = vol_info['blockvolume']['iqn']
hacount = int(vol_info['hacount'])
# Find node on which pod is running
- pod_name = get_pod_name_from_dc(self.node, dc_name)
+ pod_name = get_pod_name_from_dc(self.ocp_client[0], dc_name)
pod_info = oc_get_pods(
- self.node, selector='deploymentconfig=%s' % dc_name)
+ self.ocp_client[0], selector='deploymentconfig=%s' % dc_name)
node = pod_info[pod_name]['node']
# Get the iscsi sessions info from the node
@@ -423,7 +424,7 @@ class GlusterBlockBaseClass(BaseClass):
self.assertEqual(1, len(mpaths), msg)
validate_multipath_pod(
- self.node, pod_name, hacount, mpath=list(mpaths)[0])
+ self.ocp_client[0], pod_name, hacount, mpath=list(mpaths)[0])
return iqn, hacount, node
@@ -451,9 +452,9 @@ class GlusterBlockBaseClass(BaseClass):
pvc_name (str): pvc name for which the BHV name needs
to be returned
"""
- pv_name = get_pv_name_from_pvc(self.node, pvc_name)
+ pv_name = get_pv_name_from_pvc(self.ocp_client[0], pvc_name)
block_volume = oc_get_custom_resource(
- self.node, 'pv',
+ self.ocp_client[0], 'pv',
r':.metadata.annotations."gluster\.org\/volume\-id"',
name=pv_name
)[0]