summaryrefslogtreecommitdiffstats
path: root/cns-libs/cnslibs/common/openshift_ops.py
diff options
context:
space:
mode:
authornigoyal <nigoyal@redhat.com>2018-11-13 12:45:33 +0530
committernigoyal <nigoyal@redhat.com>2018-11-14 18:45:12 +0530
commit82dfcfe348f4b04c405f7164fce34f3d27ae69cf (patch)
tree48744784cae1170f67ad32e39ab42e6d1bf4b674 /cns-libs/cnslibs/common/openshift_ops.py
parentd27f48282d2aaaf38851e192962e765b4f23bbb5 (diff)
Remove skip of CNS-584 tc
Stop skipping CNS-584 tc with reference to the BZ-1644696 bug. Instead, add possibility to avoid this "blocker" bug, which is not the point of test. The reason is that in kube 3.11 we have "synchronous" delete operation by default. But we did have it as "async" in all the previous kube versions. So, add possibility to distinguish kube versions adding additional "--wait=false" option in kube 1.11+ versions. Change-Id: Ie92abcf4b67f7237092d62b7e8aa180d9877853c
Diffstat (limited to 'cns-libs/cnslibs/common/openshift_ops.py')
-rw-r--r--cns-libs/cnslibs/common/openshift_ops.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/cns-libs/cnslibs/common/openshift_ops.py b/cns-libs/cnslibs/common/openshift_ops.py
index 523cc375..9a12ad95 100644
--- a/cns-libs/cnslibs/common/openshift_ops.py
+++ b/cns-libs/cnslibs/common/openshift_ops.py
@@ -32,6 +32,7 @@ PODS_WIDE_RE = re.compile(
SERVICE_STATUS = "systemctl status %s"
SERVICE_RESTART = "systemctl restart %s"
SERVICE_STATUS_REGEX = "Active: active \((.*)\) since .*;.*"
+OC_VERSION = None
def oc_get_pods(ocp_node):
@@ -470,7 +471,17 @@ def oc_delete(ocp_node, rtype, name, raise_on_absence=True):
if not oc_get_yaml(ocp_node, rtype, name,
raise_on_error=raise_on_absence):
return
- ret, out, err = g.run(ocp_node, ['oc', 'delete', rtype, name])
+ cmd = ['oc', 'delete', rtype, name]
+
+ global OC_VERSION
+ if not OC_VERSION:
+ OC_VERSION = oc_version(ocp_node)
+
+ versions = ['v3.6', 'v3.7', 'v3.9', 'v3.10']
+ if not OC_VERSION.rsplit('.', 1)[0] in versions:
+ cmd.append('--wait=false')
+
+ ret, out, err = g.run(ocp_node, cmd)
if ret != 0:
g.log.error('Failed to delete resource: %s, %s: %r; %r',
rtype, name, out, err)