mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-28 07:57:38 +00:00
Remove all usage of ansible.module_utils.six from main branch (#10888)
* Get rid of all six.moves imports. * Get rid of iteritems. * Get rid of *_type(s) aliases. * Replace StringIO import. * Get rid of PY2/PY3 constants. * Get rid of raise_from. * Get rid of python_2_unicode_compatible. * Clean up global six imports. * Remove all usage of ansible.module_utils.six. * Linting. * Fix xml module. * Docs adjustments.
This commit is contained in:
parent
8f8a0e1d7c
commit
a8977afb04
113 changed files with 188 additions and 352 deletions
|
|
@ -5,14 +5,14 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
from io import StringIO
|
||||
from itertools import count
|
||||
from urllib.error import HTTPError
|
||||
|
||||
from ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak import (
|
||||
get_token,
|
||||
KeycloakError,
|
||||
)
|
||||
from ansible.module_utils.six import StringIO
|
||||
from ansible.module_utils.six.moves.urllib.error import HTTPError
|
||||
|
||||
module_params_creds = {
|
||||
'auth_keycloak_url': 'http://keycloak.url/auth',
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import json
|
|||
|
||||
import pytest
|
||||
from ansible.module_utils.common.dict_transformations import dict_merge
|
||||
from ansible.module_utils.six import iteritems
|
||||
from ansible_collections.community.general.plugins.module_utils.net_tools.pritunl import (
|
||||
api,
|
||||
)
|
||||
|
|
@ -527,7 +526,7 @@ class TestPritunlApi:
|
|||
)
|
||||
|
||||
# Ensure provided settings match with the ones returned by Pritunl
|
||||
for k, v in iteritems(pritunl_organization_data):
|
||||
for k, v in pritunl_organization_data.items():
|
||||
assert create_response[k] == v
|
||||
|
||||
@pytest.mark.parametrize("org_id", [("58070daee63f3b2e6e472c36")])
|
||||
|
|
@ -553,7 +552,7 @@ class TestPritunlApi:
|
|||
)
|
||||
|
||||
# Ensure provided settings match with the ones returned by Pritunl
|
||||
for k, v in iteritems(pritunl_user_data):
|
||||
for k, v in pritunl_user_data.items():
|
||||
assert create_response[k] == v
|
||||
|
||||
# Update the newly created user to ensure only certain settings are changed
|
||||
|
|
@ -576,7 +575,8 @@ class TestPritunlApi:
|
|||
)
|
||||
|
||||
# Ensure only certain settings changed and the rest remained untouched.
|
||||
for k, v in iteritems(update_response):
|
||||
# TODO: there is something wrong with this check!
|
||||
for k, v in update_response.items():
|
||||
if k in update_response:
|
||||
assert update_response[k] == v
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ import json
|
|||
import pytest
|
||||
|
||||
from .FakeAnsibleModule import FakeAnsibleModule
|
||||
from ansible.module_utils import six
|
||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import MagicMock
|
||||
|
||||
|
||||
|
|
@ -98,7 +97,7 @@ def fixture_data_from_file(request):
|
|||
fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures')
|
||||
fixture_data = {}
|
||||
|
||||
if isinstance(request.param, six.string_types):
|
||||
if isinstance(request.param, str):
|
||||
request.param = [request.param]
|
||||
|
||||
for fixture_name in request.param:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue