replace str with to_native (#27135)

This commit is contained in:
David Newswanger 2017-07-21 11:32:57 -04:00 committed by Chris Alfonso
parent 08327fa459
commit fd771e580f

View file

@ -137,11 +137,12 @@ from ansible.module_utils.network_common import ComplexList
from ansible.module_utils.netcli import Conditional from ansible.module_utils.netcli import Conditional
from ansible.module_utils.six import string_types from ansible.module_utils.six import string_types
from ansible.module_utils.iosxr import iosxr_argument_spec, check_args from ansible.module_utils.iosxr import iosxr_argument_spec, check_args
from ansible.module_utils._text import to_native
def to_lines(stdout): def to_lines(stdout):
for item in stdout: for item in stdout:
if isinstance(item, string_types): if isinstance(item, string_types):
item = str(item).split('\n') item = to_native(item, errors='surrogate_or_strict').split('\n')
yield item yield item
def parse_commands(module, warnings): def parse_commands(module, warnings):