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.
This commit is contained in:
Paul Neumann 2018-12-03 14:56:26 +01:00 committed by Trishna Guha
parent 5ffb863f0b
commit 4c58fbc64d

View file

@ -145,7 +145,7 @@ class Cli:
except ConnectionError as exc: except ConnectionError as exc:
self._module.fail_json(msg=to_text(exc, errors='surrogate_then_replace')) 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 self._device_configs[cmd] = cfg
return cfg return cfg