Remove set from junos_facts as it errors out (#5670)

Fix #5636 per @ganeshnalawade
This commit is contained in:
Kevin Kirsche 2016-11-22 10:59:12 -05:00 committed by Matt Clay
parent d39ae36ab1
commit 1fe0bd33f3

View file

@ -44,12 +44,12 @@ options:
- The C(config_format) argument is used to specify the desired - The C(config_format) argument is used to specify the desired
format of the configuration file. Devices support three format of the configuration file. Devices support three
configuration file formats. By default, the configuration configuration file formats. By default, the configuration
from the device is returned as text. The other options include from the device is returned as text. The other option xml.
set and xml. If the xml option is chosen, the configuration file If the xml option is chosen, the configuration file is
is returned as both xml and json. returned as both xml and json.
required: false required: false
default: text default: text
choices: ['xml', 'text', 'set'] choices: ['xml', 'text']
requirements: requirements:
- junos-eznc - junos-eznc
notes: notes:
@ -68,10 +68,10 @@ EXAMPLES = """
junos_facts: junos_facts:
config: yes config: yes
- name: collect default set of facts and configuration in set format - name: collect default set of facts and configuration in text format
junos_facts: junos_facts:
config: yes config: yes
config_format: set config_format: text
- name: collect default set of facts and configuration in XML and JSON format - name: collect default set of facts and configuration in XML and JSON format
junos_facts: junos_facts:
@ -95,7 +95,7 @@ def main():
""" """
spec = dict( spec = dict(
config=dict(type='bool'), config=dict(type='bool'),
config_format=dict(default='text', choices=['xml', 'set', 'text']), config_format=dict(default='text', choices=['xml', 'text']),
transport=dict(default='netconf', choices=['netconf']) transport=dict(default='netconf', choices=['netconf'])
) )
@ -116,7 +116,7 @@ def main():
config_format = module.params['config_format'] config_format = module.params['config_format']
resp_config = module.config.get_config(config_format=config_format) resp_config = module.config.get_config(config_format=config_format)
if config_format in ['text', 'set']: if config_format in ['text']:
facts['config'] = resp_config facts['config'] = resp_config
elif config_format == "xml": elif config_format == "xml":
facts['config'] = xml_to_string(resp_config) facts['config'] = xml_to_string(resp_config)