[stable-10] Avoid six in plugin code (#10873) (#10877)
Some checks failed
EOL CI / EOL Sanity (Ⓐ2.15) (push) Has been cancelled
EOL CI / EOL Units (Ⓐ2.15+py2.7) (push) Has been cancelled
EOL CI / EOL Units (Ⓐ2.15+py3.10) (push) Has been cancelled
EOL CI / EOL Units (Ⓐ2.15+py3.5) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/1/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/2/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/3/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/1/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/2/) (push) Has been cancelled
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/3/) (push) Has been cancelled
nox / Run extra sanity tests (push) Has been cancelled

Avoid six in plugin code (#10873)

Avoid six in plugin code.

(cherry picked from commit 6cd4665412)
This commit is contained in:
Felix Fontein 2025-10-05 07:42:27 +02:00 committed by GitHub
commit 171a028ef8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 80 additions and 130 deletions

View file

@ -224,13 +224,12 @@ want_proxmox_nodes_ansible_host: true
import itertools
import re
from urllib.parse import urlencode
from ansible.module_utils.common._collections_compat import MutableMapping
from ansible.errors import AnsibleError
from ansible.plugins.inventory import BaseInventoryPlugin, Constructable, Cacheable
from ansible.module_utils.six import string_types
from ansible.module_utils.six.moves.urllib.parse import urlencode
from ansible.utils.display import Display
from ansible_collections.community.general.plugins.module_utils.version import LooseVersion
@ -498,7 +497,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
out_val[k] = v
value = out_val
if config not in plaintext_configs and isinstance(value, string_types) \
if config not in plaintext_configs and isinstance(value, str) \
and all("=" in v for v in value.split(",")):
# split off strings with commas to a dict
# skip over any keys that cannot be processed