summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorJose A. Rivera <jarrpa@redhat.com>2017-03-26 23:48:40 -0500
committerJose A. Rivera <jarrpa@redhat.com>2017-04-03 12:08:08 -0500
commit2a97044c83987f4e7fd938b50ed451aa91d22a68 (patch)
tree7b898e7b16d8112191a2ffc3e3fce11969738ba7 /roles
parent0bac74c346bb5c620bdf1941b40c29ff3083e2b0 (diff)
downloadopenshift-2a97044c83987f4e7fd938b50ed451aa91d22a68.tar.gz
openshift-2a97044c83987f4e7fd938b50ed451aa91d22a68.tar.bz2
openshift-2a97044c83987f4e7fd938b50ed451aa91d22a68.tar.xz
openshift-2a97044c83987f4e7fd938b50ed451aa91d22a68.zip
oc_configmap: Add missing check for name
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Diffstat (limited to 'roles')
-rw-r--r--roles/lib_openshift/library/oc_configmap.py4
-rw-r--r--roles/lib_openshift/src/class/oc_configmap.py4
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 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
########