mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
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:
parent
f23f2468ec
commit
cc9ed352dd
3 changed files with 6 additions and 5 deletions
|
@ -121,7 +121,7 @@ def load_configuration(module, candidate=None, action='merge', rollback=None, fo
|
|||
if format == 'xml':
|
||||
cfg.append(fromstring(candidate))
|
||||
else:
|
||||
cfg.text = to_text(candidate, encoding='latin1')
|
||||
cfg.text = to_text(candidate, encoding='latin-1')
|
||||
else:
|
||||
cfg.append(candidate)
|
||||
return send_request(module, obj)
|
||||
|
@ -187,7 +187,7 @@ def get_diff(module):
|
|||
|
||||
output = reply.find('.//configuration-output')
|
||||
if output is not None:
|
||||
return to_text(output.text, encoding='latin1').strip()
|
||||
return to_text(output.text, encoding='latin-1').strip()
|
||||
|
||||
|
||||
def load_config(module, candidate, warnings, action='merge', format='xml'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue