From 82b49c7cf295649bf3d32f2403840e7b92bb6aad Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 4 Oct 2025 23:18:11 +0200 Subject: [PATCH] Fix wrong replacements. (#1139) --- changelogs/fragments/1137-six.yml | 2 +- plugins/connection/docker.py | 2 +- plugins/connection/docker_api.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/changelogs/fragments/1137-six.yml b/changelogs/fragments/1137-six.yml index 7e56366a..1e4ab093 100644 --- a/changelogs/fragments/1137-six.yml +++ b/changelogs/fragments/1137-six.yml @@ -1,2 +1,2 @@ bugfixes: - - "Avoid usage of deprecated ``ansible.module_utils.six`` in all code that does not have to support Python 2 (https://github.com/ansible-collections/community.docker/pull/1137)." + - "Avoid usage of deprecated ``ansible.module_utils.six`` in all code that does not have to support Python 2 (https://github.com/ansible-collections/community.docker/pull/1137, https://github.com/ansible-collections/community.docker/pull/1139)." diff --git a/plugins/connection/docker.py b/plugins/connection/docker.py index 84826d4d..ad6e2340 100644 --- a/plugins/connection/docker.py +++ b/plugins/connection/docker.py @@ -248,7 +248,7 @@ class Connection(ConnectionBase): if self.get_option('extra_env'): for k, v in self.get_option('extra_env').items(): for val, what in ((k, 'Key'), (v, 'Value')): - if not isinstance(val, (str, bytes)): + if not isinstance(val, str): raise AnsibleConnectionFailure( 'Non-string {0} found for extra_env option. Ambiguous env options must be ' 'wrapped in quotes to avoid them being interpreted. {1}: {2!r}' diff --git a/plugins/connection/docker_api.py b/plugins/connection/docker_api.py index 5ebe7cd9..eb21a293 100644 --- a/plugins/connection/docker_api.py +++ b/plugins/connection/docker_api.py @@ -243,7 +243,7 @@ class Connection(ConnectionBase): data['Env'] = [] for k, v in self.get_option('extra_env').items(): for val, what in ((k, 'Key'), (v, 'Value')): - if not isinstance(val, (str, bytes)): + if not isinstance(val, str): raise AnsibleConnectionFailure( 'Non-string {0} found for extra_env option. Ambiguous env options must be ' 'wrapped in quotes to avoid them being interpreted. {1}: {2!r}'