1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix #23360 junos_config set format issue (#23365)

This commit is contained in:
Ganesh Nalawade 2017-04-06 22:15:15 +05:30 committed by Chris Alfonso
parent 98c23a3342
commit 990ba90380

View file

@ -234,8 +234,6 @@ def filter_delete_statements(module, candidate):
def configure_device(module, warnings):
candidate = module.params['lines'] or module.params['src']
if isinstance(candidate, string_types):
candidate = candidate.split('\n')
kwargs = {
'comment': module.params['comment'],
@ -257,6 +255,9 @@ def configure_device(module, warnings):
else:
kwargs.update({'format': config_format, 'action': module.params['update']})
if isinstance(candidate, string_types):
candidate = candidate.split('\n')
# this is done to filter out `delete ...` statements which map to
# nothing in the config as that will cause an exception to be raised
if any((module.params['lines'], config_format == 'set')):