Ensure proper conversion while backing up of junos config (#28958)

* Ensure proper conversion while backing up of junos config

* Minor changes

* Fix review comment

*  Open config backup file in binary mode
This commit is contained in:
Ganesh Nalawade 2017-09-04 20:12:11 +05:30 committed by GitHub
commit cc9ed352dd
3 changed files with 6 additions and 5 deletions

View file

@ -256,7 +256,7 @@ def filter_delete_statements(module, candidate):
if match is None:
# Could not find configuration-set in reply, perhaps device does not support it?
return candidate
config = to_native(match.text, encoding='latin1')
config = to_native(match.text, encoding='latin-1')
modified_candidate = candidate[:]
for index, line in reversed(list(enumerate(candidate))):