Fix 5646 junos_config issue if config format is text (#5658)

If 'src_format' is not mentioned in playbook
and config is in text format a list object is
passed to 'guess_format' function instead
of string, hence TypeError execption is seen.
Fix is to pass string object instead of list.
This commit is contained in:
Ganesh Nalawade 2016-11-22 21:28:14 +05:30 committed by Matt Clay
parent 2ba5967673
commit d39ae36ab1

View file

@ -245,7 +245,7 @@ def load_config(module, result):
kwargs['commit'] = not module.check_mode
if module.params['src']:
config_format = module.params['src_format'] or guess_format(candidate)
config_format = module.params['src_format'] or guess_format(str(candidate))
elif module.params['lines']:
config_format = 'set'
kwargs['config_format'] = config_format