diff options
author | Kenny Woodson <kwoodson@redhat.com> | 2017-03-21 15:53:01 -0400 |
---|---|---|
committer | Kenny Woodson <kwoodson@redhat.com> | 2017-03-21 15:53:01 -0400 |
commit | 3d484dd5e5ac4a8ba0c4b50baba79d6d7e5bba7e (patch) | |
tree | 627b64c6ce28a3c8e091fd14b5c6035a84ea4405 /roles/lib_openshift | |
parent | d28ae1f745aaedccdb1dc6a168a28accf643f15d (diff) | |
download | openshift-3d484dd5e5ac4a8ba0c4b50baba79d6d7e5bba7e.tar.gz openshift-3d484dd5e5ac4a8ba0c4b50baba79d6d7e5bba7e.tar.bz2 openshift-3d484dd5e5ac4a8ba0c4b50baba79d6d7e5bba7e.tar.xz openshift-3d484dd5e5ac4a8ba0c4b50baba79d6d7e5bba7e.zip |
Adding error checking to the delete.
Diffstat (limited to 'roles/lib_openshift')
-rw-r--r-- | roles/lib_openshift/library/oc_configmap.py | 4 | ||||
-rw-r--r-- | roles/lib_openshift/src/class/oc_configmap.py | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/roles/lib_openshift/library/oc_configmap.py b/roles/lib_openshift/library/oc_configmap.py index 0b6f1adf8..90d38c7a9 100644 --- a/roles/lib_openshift/library/oc_configmap.py +++ b/roles/lib_openshift/library/oc_configmap.py @@ -1492,6 +1492,10 @@ class OCConfigMap(OpenShiftCLI): return {'changed': True, 'msg': 'CHECK_MODE: Would have performed a delete.'} api_rval = oc_cm.delete() + + if api_rval['returncode'] != 0: + return {'failed': True, 'msg': api_rval} + return {'changed': True, 'results': api_rval, 'state': state} ######## diff --git a/roles/lib_openshift/src/class/oc_configmap.py b/roles/lib_openshift/src/class/oc_configmap.py index c034ead36..87de3e1df 100644 --- a/roles/lib_openshift/src/class/oc_configmap.py +++ b/roles/lib_openshift/src/class/oc_configmap.py @@ -138,6 +138,10 @@ class OCConfigMap(OpenShiftCLI): return {'changed': True, 'msg': 'CHECK_MODE: Would have performed a delete.'} api_rval = oc_cm.delete() + + if api_rval['returncode'] != 0: + return {'failed': True, 'msg': api_rval} + return {'changed': True, 'results': api_rval, 'state': state} ######## |