1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix netconf port validation and minor doc change (#24210)

* Fix netconf port validation and minor doc change

Add check to confirm if `validate_*` funcion is
callable.

Add `config_format` in `junos_facts` documentation

* Fix review comments
This commit is contained in:
Ganesh Nalawade 2017-05-03 14:28:20 +05:30 committed by GitHub
parent 7195c31753
commit 73c24001d9
2 changed files with 10 additions and 1 deletions

View file

@ -46,6 +46,15 @@ options:
required: false required: false
default: "!config" default: "!config"
version_added: "2.3" version_added: "2.3"
config_format:
description:
- The I(config_format) argument specifies the format of the configuration
when serializing output from the device. This argument is applicable
only when C(config) value is present in I(gather_subset).
required: false
default: text
choices: ['xml', 'set', 'text', 'json']
version_added: "2.3"
""" """
EXAMPLES = """ EXAMPLES = """

View file

@ -139,7 +139,7 @@ def map_params_to_obj(module):
for key, value in iteritems(obj): for key, value in iteritems(obj):
# validate the param value (if validator func exists) # validate the param value (if validator func exists)
validator = globals().get('validate_%s' % key) validator = globals().get('validate_%s' % key)
if all((value, validator)): if callable(validator):
validator(value, module) validator(value, module)
return obj return obj