diff options
author | Wim de With <wf@dewith.io> | 2020-12-09 01:25:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-09 00:25:04 +0000 |
commit | 59dad0ffed43b0f7fc3026fc8014e2092cb5b68b (patch) | |
tree | b0e5124337b960a40eba47dd947e770c5ee8b9b8 /plugins/modules/vyos_config.py | |
parent | 6c51003d205242acd18bdfb6bd3400c5cfdba419 (diff) | |
download | vyos.vyos-59dad0ffed43b0f7fc3026fc8014e2092cb5b68b.tar.gz vyos.vyos-59dad0ffed43b0f7fc3026fc8014e2092cb5b68b.zip |
vyos_config: Fix config being processed as command (#94)
vyos_config: Fix config being processed as command
Reviewed-by: https://github.com/apps/ansible-zuul
Diffstat (limited to 'plugins/modules/vyos_config.py')
-rw-r--r-- | plugins/modules/vyos_config.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/modules/vyos_config.py b/plugins/modules/vyos_config.py index 5e4836d..8efad38 100644 --- a/plugins/modules/vyos_config.py +++ b/plugins/modules/vyos_config.py @@ -209,7 +209,11 @@ def get_candidate(module): contents = module.params["src"] or module.params["lines"] if module.params["src"]: - contents = format_commands(contents.splitlines()) + contents = contents.splitlines() + if len(contents) > 0: + line = contents[0].split() + if len(line) > 0 and line[0] in ("set", "delete"): + contents = format_commands(contents) contents = "\n".join(contents) return contents |