diff options
author | Valerii Ponomarov <vponomar@redhat.com> | 2019-01-02 12:52:52 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.host.prod.eng.bos.redhat.com> | 2019-01-02 12:52:52 +0000 |
commit | a755c864ba24ea18622de367b20ea7d3b0b4361f (patch) | |
tree | 25a116410a325e57712b622e8b72e738051e0949 | |
parent | 17e6e30010d5a26ced72a45ec3b868f92d8b9697 (diff) | |
parent | cfd6ca362386219646c010cde3ec60f0e5e9b140 (diff) |
Merge "Add events info for 'verify_pvc_status_is_bound' common func"
-rw-r--r-- | cns-libs/cnslibs/common/openshift_ops.py | 14 |
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) |