From 39291d3c6008659cc761464c258e7b305d4970d9 Mon Sep 17 00:00:00 2001 From: Alexei Znamensky <103110+russoz@users.noreply.github.com> Date: Sun, 26 Oct 2025 20:02:03 +1300 Subject: [PATCH] keyring & keyring_info: import shlex directly (#10981) * keyring & keyring_info: import shlex directly * add changelog frag --- changelogs/fragments/10981-keyring-shlex.yml | 3 +++ plugins/modules/keyring.py | 5 +---- plugins/modules/keyring_info.py | 5 +---- 3 files changed, 5 insertions(+), 8 deletions(-) create mode 100644 changelogs/fragments/10981-keyring-shlex.yml diff --git a/changelogs/fragments/10981-keyring-shlex.yml b/changelogs/fragments/10981-keyring-shlex.yml new file mode 100644 index 0000000000..8034ebe55d --- /dev/null +++ b/changelogs/fragments/10981-keyring-shlex.yml @@ -0,0 +1,3 @@ +minor_changes: + - keyring - remove provisions for unsupported Python versions (https://github.com/ansible-collections/community.general/pull/10981). + - keyring_info - remove provisions for unsupported Python versions (https://github.com/ansible-collections/community.general/pull/10981). diff --git a/plugins/modules/keyring.py b/plugins/modules/keyring.py index 8805a82e09..9653ef1ad5 100644 --- a/plugins/modules/keyring.py +++ b/plugins/modules/keyring.py @@ -76,10 +76,7 @@ EXAMPLES = r""" state: absent """ -try: - from shlex import quote -except ImportError: - from pipes import quote +from shlex import quote import traceback from ansible.module_utils.basic import AnsibleModule, missing_required_lib diff --git a/plugins/modules/keyring_info.py b/plugins/modules/keyring_info.py index 6ece284533..cddc2f973b 100644 --- a/plugins/modules/keyring_info.py +++ b/plugins/modules/keyring_info.py @@ -62,10 +62,7 @@ passphrase: sample: Password123 """ -try: - from shlex import quote -except ImportError: - from pipes import quote +from shlex import quote import traceback from ansible.module_utils.basic import AnsibleModule, missing_required_lib