diff options
| author | Apeksha D Khakharia <akhakhar@redhat.com> | 2018-08-08 17:31:30 +0530 |
|---|---|---|
| committer | Apeksha D Khakharia <akhakhar@redhat.com> | 2018-08-08 17:57:11 +0530 |
| commit | 264e037a5443300aab3f74302ed7ce34ea8a982e (patch) | |
| tree | 65404ce02b99f5d3320e4599681f7e522ff9ccfa /cns-libs | |
| parent | 3f2f40ec0e4c2d2ff548fcc3b2db5dc9b700007d (diff) | |
CNS: fix scale_pod_wait library
Change-Id: I52cb4e6360676db1b75764ec314ec53c017ae8d2
Signed-off-by: Apeksha D Khakharia <akhakhar@redhat.com>
Diffstat (limited to 'cns-libs')
| -rw-r--r-- | cns-libs/cnslibs/common/openshift_ops.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cns-libs/cnslibs/common/openshift_ops.py b/cns-libs/cnslibs/common/openshift_ops.py index 7f2d2de0..d5e11b67 100644 --- a/cns-libs/cnslibs/common/openshift_ops.py +++ b/cns-libs/cnslibs/common/openshift_ops.py @@ -418,21 +418,23 @@ def wait_for_resource_absence(ocp_node, rtype, name, raise exceptions.ExecutionError(error_msg) -def scale_heketi_pod_amount_and_wait(hostname, dc_name, - namespace, pod_amount=1): +def scale_dc_pod_amount_and_wait(hostname, dc_name, + pod_amount=1, namespace=None): ''' - This function scales heketi_pod and waits + This function scales pod and waits If pod_amount 0 waits for its absence - If pod_amount =>1 waits for all pods to be ready + If pod_amount => 1 waits for all pods to be ready Args: hostname (str): Node on which the ocp command will run dc_name (str): Name of heketi dc namespace (str): Namespace pod_amount (int): Number of heketi pods to scale ex: 0, 1 or 2 + default 1 ''' - heketi_scale_cmd = "oc scale --replicas=%d dc/%s --namespace %s" % ( - dc_name, pod_amount, namespace) + namespace_arg = "--namespace=%s" % namespace if namespace else "" + heketi_scale_cmd = "oc scale --replicas=%d dc/%s %s" % ( + pod_amount, dc_name, namespace_arg) ret, out, err = g.run(hostname, heketi_scale_cmd, "root") if ret != 0: error_msg = ("failed to execute cmd %s " |
