From 7607c3786f6a5be3f907dd711ec3a7817ba4b6d3 Mon Sep 17 00:00:00 2001 From: s-hertel <19572925+s-hertel@users.noreply.github.com> Date: Fri, 3 Mar 2023 13:28:06 -0500 Subject: [PATCH 1/2] remove deprecated internal argument from synchronize the new_stdin argument is no longer used to instantiate a connection plugin --- plugins/action/synchronize.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/action/synchronize.py b/plugins/action/synchronize.py index c70db5f..cdebaf1 100644 --- a/plugins/action/synchronize.py +++ b/plugins/action/synchronize.py @@ -284,9 +284,6 @@ class ActionModule(ActionBase): # told (via delegate_to) that a different host is the source of the # rsync if not use_delegate and remote_transport: - # Create a connection to localhost to run rsync on - new_stdin = self._connection._new_stdin - # Unlike port, there can be only one shell localhost_shell = None for host in C.LOCALHOST: @@ -315,7 +312,11 @@ class ActionModule(ActionBase): localhost_executable = C.DEFAULT_EXECUTABLE self._play_context.executable = localhost_executable - new_connection = connection_loader.get('local', self._play_context, new_stdin) + try: + new_connection = connection_loader.get('local', self._play_context) + except TypeError: + # Needed for ansible-core < 2.15 + new_connection = connection_loader.get('local', self._play_context, self._connection._new_stdin) self._connection = new_connection # Override _remote_is_local as an instance attribute specifically for the synchronize use case # ensuring we set local tmpdir correctly From 8af85a0899910e788e233f3a413769d3b8952835 Mon Sep 17 00:00:00 2001 From: s-hertel <19572925+s-hertel@users.noreply.github.com> Date: Fri, 3 Mar 2023 15:02:53 -0500 Subject: [PATCH 2/2] add a changelog --- changelogs/fragments/421-remove-deprecation-warning.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/421-remove-deprecation-warning.yml diff --git a/changelogs/fragments/421-remove-deprecation-warning.yml b/changelogs/fragments/421-remove-deprecation-warning.yml new file mode 100644 index 0000000..5224f1e --- /dev/null +++ b/changelogs/fragments/421-remove-deprecation-warning.yml @@ -0,0 +1,2 @@ +trivial: + - synchronize - instantiate the connection plugin without the ``new_stdin`` argument, which is deprecated in ansible-core 2.15 (https://github.com/ansible-collections/ansible.posix/pull/421).