Move persistent connections to only use registered variables (#45616)

* Try to intuit proper plugins to send to ansible-connection

* Move sub-plugins to init so that vars will be populated in executor

* Fix connection unit tests
This commit is contained in:
Nathaniel Case 2018-09-20 09:56:43 -04:00 committed by GitHub
parent 86c48205c4
commit 406b59aeba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 98 additions and 109 deletions

View file

@ -41,6 +41,7 @@ from ansible.plugins.connection.ssh import Connection as SSHConnection
from ansible.plugins.connection.docker import Connection as DockerConnection
# from ansible.plugins.connection.winrm import Connection as WinRmConnection
from ansible.plugins.connection.network_cli import Connection as NetworkCliConnection
from ansible.plugins.connection.httpapi import Connection as HttpapiConnection
PY3 = sys.version_info[0] == 3
@ -162,11 +163,16 @@ class TestConnectionBaseClass(unittest.TestCase):
# self.assertIsInstance(WinRmConnection(), WinRmConnection)
def test_network_cli_connection_module(self):
self.play_context.network_os = 'eos'
self.assertIsInstance(NetworkCliConnection(self.play_context, self.in_stream), NetworkCliConnection)
def test_netconf_connection_module(self):
self.assertIsInstance(NetconfConnection(self.play_context, self.in_stream), NetconfConnection)
def test_httpapi_connection_module(self):
self.play_context.network_os = 'eos'
self.assertIsInstance(HttpapiConnection(self.play_context, self.in_stream), HttpapiConnection)
def test_check_password_prompt(self):
local = (
b'[sudo via ansible, key=ouzmdnewuhucvuaabtjmweasarviygqq] password: \n'