Revert "Deprecate Entity, EntityCollection and use subspec in network modules (#33575)" (#33849)

This reverts commit 4349b56643.
This commit is contained in:
Ganesh Nalawade 2017-12-13 13:07:52 +05:30 committed by GitHub
parent b6528ea19f
commit ea18b9021a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 200 additions and 195 deletions

View file

@ -1929,23 +1929,14 @@ class AnsibleModule(object):
self._options_context.append(k)
key = None
for (name, value) in spec.items():
# specifies how to map a single value to spec
if value.get('key'):
key = name
break
if isinstance(params[k], dict):
elements = [params[k]]
else:
elements = params[k]
for index, param in enumerate(elements):
for param in elements:
if not isinstance(param, dict):
if key is None:
self.fail_json(msg="options spec require a key argument to map it to a single value '%s'" % param)
elements[index] = param = {key: param}
self.fail_json(msg="value of %s must be of type dict or list of dict" % k)
self._set_fallbacks(spec, param)
options_aliases = self._handle_aliases(spec, param)