From 2127459794612e618dc41c4ab739daa45a5f1e1c Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Thu, 13 Oct 2016 15:06:50 -0400 Subject: [PATCH] fixes bug introduced in 3670215 in junos_config (#5251) The previous fix created a new bug that this PR resolves --- lib/ansible/modules/network/junos/junos_config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/junos/junos_config.py b/lib/ansible/modules/network/junos/junos_config.py index 6328fb5573..f4d125831b 100644 --- a/lib/ansible/modules/network/junos/junos_config.py +++ b/lib/ansible/modules/network/junos/junos_config.py @@ -217,7 +217,7 @@ def diff_commands(commands, config): updates = list() visited = set() - for item in commands.split('\n'): + for item in commands: if len(item) > 0: if not item.startswith('set') and not item.startswith('delete'): raise ValueError('line must start with either `set` or `delete`') @@ -235,6 +235,8 @@ def diff_commands(commands, config): def load_config(module, result): candidate = module.params['lines'] or module.params['src'] + if isinstance(candidate, basestring): + candidate = candidate.split('\n') kwargs = dict() kwargs['comment'] = module.params['comment']