summaryrefslogtreecommitdiffstats
path: root/cns-libs/cnslibs/common/openshift_ops.py
diff options
context:
space:
mode:
Diffstat (limited to 'cns-libs/cnslibs/common/openshift_ops.py')
-rw-r--r--cns-libs/cnslibs/common/openshift_ops.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/cns-libs/cnslibs/common/openshift_ops.py b/cns-libs/cnslibs/common/openshift_ops.py
index 172a3d6a..9a84ee83 100644
--- a/cns-libs/cnslibs/common/openshift_ops.py
+++ b/cns-libs/cnslibs/common/openshift_ops.py
@@ -1033,12 +1033,16 @@ def verify_pvc_status_is_bound(hostname, pvc_name, timeout=120, wait_step=3):
if msg:
raise AssertionError(msg)
if w.expired:
- # for debug purpose to see why provisioning failed
- cmd = "oc describe pvc %s | grep ProvisioningFailed" % pvc_name
- ret, out, err = g.run(hostname, cmd, "root")
- g.log.info("cmd %s - out- %s err- %s" % (cmd, out, err))
msg = ("Exceeded timeout of '%s' seconds for verifying PVC '%s' "
- "to reach the 'Bound' status." % (timeout, pvc_name))
+ "to reach the 'Bound' state." % (timeout, pvc_name))
+
+ # Gather more info for ease of debugging
+ try:
+ pvc_events = get_events(hostname, obj_name=pvc_name)
+ except Exception:
+ pvc_events = '?'
+ msg += "\nPVC events: %s" % pvc_events
+
g.log.error(msg)
raise AssertionError(msg)