diff --git a/changelogs/fragments/63954-synchronize-remove-unused-block.yml b/changelogs/fragments/63954-synchronize-remove-unused-block.yml new file mode 100644 index 00000000000..0c297d3058f --- /dev/null +++ b/changelogs/fragments/63954-synchronize-remove-unused-block.yml @@ -0,0 +1,2 @@ +bugfixes: +- synchronize - remove unused block (https://github.com/ansible/ansible/issues/63954) \ No newline at end of file diff --git a/lib/ansible/plugins/action/synchronize.py b/lib/ansible/plugins/action/synchronize.py index 0c0a89cbf0e..753315430d4 100644 --- a/lib/ansible/plugins/action/synchronize.py +++ b/lib/ansible/plugins/action/synchronize.py @@ -417,10 +417,4 @@ class ActionModule(ActionBase): # run the module and store the result result.update(self._execute_module('synchronize', module_args=_tmp_args, task_vars=task_vars)) - if 'SyntaxError' in result.get('exception', result.get('msg', '')): - # Emit a warning about using python3 because synchronize is - # somewhat unique in running on localhost - result['exception'] = result['msg'] - result['msg'] = ('SyntaxError parsing module. Perhaps invoking "python" on your local (or delegate_to) machine invokes python3. ' - 'You can set ansible_python_interpreter for localhost (or the delegate_to machine) to the location of python2 to fix this') return result