mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
fix unicode errors in iosxr
This commit is contained in:
committed by
Toshio Kuratomi
parent
045f0ff520
commit
0b5b5ec50a
@@ -25,7 +25,7 @@ import time
|
||||
import glob
|
||||
|
||||
from ansible.plugins.action.iosxr import ActionModule as _ActionModule
|
||||
from ansible.module_utils._text import to_text
|
||||
from ansible.module_utils._text import to_text, to_bytes
|
||||
from ansible.module_utils.six.moves.urllib.parse import urlsplit
|
||||
from ansible.utils.vars import merge_hash
|
||||
|
||||
@@ -74,7 +74,7 @@ class ActionModule(_ActionModule):
|
||||
os.remove(fn)
|
||||
tstamp = time.strftime("%Y-%m-%d@%H:%M:%S", time.localtime(time.time()))
|
||||
filename = '%s/%s_config.%s' % (backup_path, host, tstamp)
|
||||
open(filename, 'w').write(contents)
|
||||
open(filename, 'w').write(to_bytes(contents))
|
||||
return filename
|
||||
|
||||
def _handle_template(self):
|
||||
|
||||
Reference in New Issue
Block a user