Browse Source

Adding error checking to the delete.

Kenny Woodson 8 years ago
parent
commit
3d484dd5e5

+ 4 - 0
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}
 
         ########

+ 4 - 0
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}
 
         ########