diff --git a/lib/ansible/plugins/connection/httpapi.py b/lib/ansible/plugins/connection/httpapi.py index a8718c5e87..05a6628032 100644 --- a/lib/ansible/plugins/connection/httpapi.py +++ b/lib/ansible/plugins/connection/httpapi.py @@ -140,9 +140,11 @@ options: - name: ANSIBLE_PERSISTENT_COMMAND_TIMEOUT """ +from io import BytesIO + from ansible.errors import AnsibleConnectionFailure from ansible.module_utils._text import to_bytes -from ansible.module_utils.six import PY3, BytesIO +from ansible.module_utils.six import PY3 from ansible.module_utils.six.moves import cPickle from ansible.module_utils.six.moves.urllib.error import HTTPError, URLError from ansible.module_utils.urls import open_url diff --git a/lib/ansible/plugins/connection/network_cli.py b/lib/ansible/plugins/connection/network_cli.py index 34151d01b8..f25f7706e5 100644 --- a/lib/ansible/plugins/connection/network_cli.py +++ b/lib/ansible/plugins/connection/network_cli.py @@ -166,9 +166,10 @@ import re import os import socket import traceback +from io import BytesIO from ansible.errors import AnsibleConnectionFailure -from ansible.module_utils.six import BytesIO, PY3 +from ansible.module_utils.six import PY3 from ansible.module_utils.six.moves import cPickle from ansible.module_utils.network.common.utils import to_list from ansible.module_utils._text import to_bytes, to_text diff --git a/test/units/plugins/httpapi/test_ftd.py b/test/units/plugins/httpapi/test_ftd.py index 4832b47b8f..3a5dd0a4e8 100644 --- a/test/units/plugins/httpapi/test_ftd.py +++ b/test/units/plugins/httpapi/test_ftd.py @@ -18,6 +18,7 @@ import json import os +from io import BytesIO from ansible.module_utils.six.moves.urllib.error import HTTPError @@ -28,7 +29,7 @@ from ansible.errors import AnsibleConnectionFailure from ansible.module_utils.connection import ConnectionError from ansible.module_utils.network.ftd.common import HTTPMethod, ResponseParams from ansible.module_utils.network.ftd.fdm_swagger_client import SpecProp, FdmSwaggerParser -from ansible.module_utils.six import BytesIO, PY3, StringIO +from ansible.module_utils.six import PY3, StringIO from ansible.plugins.httpapi.ftd import HttpApi if PY3: