From 399e72abb031b7571762a5c9e1435404603fc691 Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Tue, 5 Dec 2017 15:11:49 +0530 Subject: [PATCH] Fix reconstructing socket path in network_cli (#33572) * Persistent connection socket path is hash of remote address, port, remote user and connection type. * Integration test fixes --- lib/ansible/plugins/connection/network_cli.py | 2 +- test/integration/targets/ios_interface/tests/cli/intent.yaml | 2 +- test/integration/targets/ios_user/tests/cli/auth.yaml | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/connection/network_cli.py b/lib/ansible/plugins/connection/network_cli.py index ff861bce08..27c7fbd2df 100644 --- a/lib/ansible/plugins/connection/network_cli.py +++ b/lib/ansible/plugins/connection/network_cli.py @@ -216,7 +216,7 @@ class Connection(ConnectionBase): value to None and the _connected value to False ''' ssh = connection_loader.get('ssh', class_only=True) - cp = ssh._create_control_path(self._play_context.remote_addr, self._play_context.port, self._play_context.remote_user) + cp = ssh._create_control_path(self._play_context.remote_addr, self._play_context.port, self._play_context.remote_user, self._play_context.connection) tmp_path = unfrackpath(C.PERSISTENT_CONTROL_PATH_DIR) socket_path = unfrackpath(cp % dict(directory=tmp_path)) diff --git a/test/integration/targets/ios_interface/tests/cli/intent.yaml b/test/integration/targets/ios_interface/tests/cli/intent.yaml index fb5db6a3c8..8af87d1107 100644 --- a/test/integration/targets/ios_interface/tests/cli/intent.yaml +++ b/test/integration/targets/ios_interface/tests/cli/intent.yaml @@ -21,7 +21,7 @@ name: "{{ test_interface }}" state: up tx_rate: ge(0) - rx_rate: le(0) + rx_rate: ge(0) authorize: yes register: result diff --git a/test/integration/targets/ios_user/tests/cli/auth.yaml b/test/integration/targets/ios_user/tests/cli/auth.yaml index f121502615..27cf9245e7 100644 --- a/test/integration/targets/ios_user/tests/cli/auth.yaml +++ b/test/integration/targets/ios_user/tests/cli/auth.yaml @@ -35,3 +35,6 @@ state: absent authorize: yes register: result + + - name: reset connection + meta: reset_connection