From 4c58fbc64d4a58a960ff0dbffa24b022f664be5e Mon Sep 17 00:00:00 2001 From: Paul Neumann Date: Mon, 3 Dec 2018 14:56:26 +0100 Subject: [PATCH] nxos: Make sure config ends with a linefeed (#48465) The config parser on NX-OS does not deal with configs that do not end with a linefeed correctly which leads to various issues when the config is loaded from startup-config upon reboot. Therefore, ensure that the config returned is terminated by a linefeed. --- lib/ansible/module_utils/network/nxos/nxos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/network/nxos/nxos.py b/lib/ansible/module_utils/network/nxos/nxos.py index 81d665fcfc8..140cabda919 100644 --- a/lib/ansible/module_utils/network/nxos/nxos.py +++ b/lib/ansible/module_utils/network/nxos/nxos.py @@ -145,7 +145,7 @@ class Cli: except ConnectionError as exc: self._module.fail_json(msg=to_text(exc, errors='surrogate_then_replace')) - cfg = to_text(out, errors='surrogate_then_replace').strip() + cfg = to_text(out, errors='surrogate_then_replace').strip() + '\n' self._device_configs[cmd] = cfg return cfg