From 2a97044c83987f4e7fd938b50ed451aa91d22a68 Mon Sep 17 00:00:00 2001 From: "Jose A. Rivera" Date: Sun, 26 Mar 2017 23:48:40 -0500 Subject: oc_configmap: Add missing check for name Signed-off-by: Jose A. Rivera --- roles/lib_openshift/library/oc_configmap.py | 4 ++++ roles/lib_openshift/src/class/oc_configmap.py | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'roles/lib_openshift') diff --git a/roles/lib_openshift/library/oc_configmap.py b/roles/lib_openshift/library/oc_configmap.py index 96345ffe0..c60f4661c 100644 --- a/roles/lib_openshift/library/oc_configmap.py +++ b/roles/lib_openshift/library/oc_configmap.py @@ -1524,6 +1524,10 @@ class OCConfigMap(OpenShiftCLI): if state == 'list': return {'changed': False, 'results': api_rval, 'state': state} + if not params['name']: + return {'failed': True, + 'msg': 'Please specify a name when state is absent|present.'} + ######## # Delete ######## diff --git a/roles/lib_openshift/src/class/oc_configmap.py b/roles/lib_openshift/src/class/oc_configmap.py index 87de3e1df..de77d1102 100644 --- a/roles/lib_openshift/src/class/oc_configmap.py +++ b/roles/lib_openshift/src/class/oc_configmap.py @@ -127,6 +127,10 @@ class OCConfigMap(OpenShiftCLI): if state == 'list': return {'changed': False, 'results': api_rval, 'state': state} + if not params['name']: + return {'failed': True, + 'msg': 'Please specify a name when state is absent|present.'} + ######## # Delete ######## -- cgit v1.2.3