From d39ae36ab14750207e5afeadd387fc0cc1d86f0f Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Tue, 22 Nov 2016 21:28:14 +0530 Subject: [PATCH] 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. --- lib/ansible/modules/network/junos/junos_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/junos/junos_config.py b/lib/ansible/modules/network/junos/junos_config.py index f4d125831be..0ae2d3fd21e 100644 --- a/lib/ansible/modules/network/junos/junos_config.py +++ b/lib/ansible/modules/network/junos/junos_config.py @@ -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