Base connection class for network-style connections (#41839)

* Create base class for network-style connections

* clean up some differences

* Move NetworkConnectionBase

* Tweak netconf for tests

* Tweak when network_os is checked to avoid failing tests

* Pull back exec_command
This commit is contained in:
Nathaniel Case 2018-07-02 08:41:00 -04:00 committed by GitHub
commit 5850591d14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 198 additions and 253 deletions

View file

@ -64,10 +64,10 @@ class TestConnectionClass(unittest.TestCase):
@patch("ansible.plugins.connection.paramiko_ssh.Connection._connect")
def test_network_cli__connect(self, mocked_super, mocked_terminal_loader):
pc = PlayContext()
pc.network_os = 'ios'
new_stdin = StringIO()
conn = connection_loader.get('network_cli', pc, '/dev/null')
pc.network_os = 'ios'
conn.ssh = MagicMock()
conn.receive = MagicMock()