summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Sprygada <privateip@users.noreply.github.com>2016-10-13 15:06:50 -0400
committerPeter Sprygada <psprygada@ansible.com>2016-10-13 15:12:22 -0400
commitdf24fbf91922b5abd1037f9311445acc1894d9ef (patch)
treecd0bec7c422ada334951347e02eaff7f9b199867
parentc1682d10604272ab110ee31f6525a3acc77bfccd (diff)
downloadansible-modules-core-df24fbf91922b5abd1037f9311445acc1894d9ef.tar.gz
fixes bug introduced in 3670215 in junos_config (#5251)
The previous fix created a new bug that this PR resolves (cherry picked from commit 6795954dc80c444e608e3b26a3c5666fb28847a3)
-rw-r--r--network/junos/junos_config.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/network/junos/junos_config.py b/network/junos/junos_config.py
index 5e2ead6a..f0814a0b 100644
--- a/network/junos/junos_config.py
+++ b/network/junos/junos_config.py
@@ -214,7 +214,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`')
@@ -232,6 +232,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']