Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add terminal_initial_newline to network_cli module #593

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

wrouesnel
Copy link

terminal_initial_newline, when set to true sends a single newline character to the remote device immediately after initially connecting.

This allows network_cli to work with some types of equipment which fail to send any data when SSH connectivity is initially established, such as serial-port multiplexers.

SUMMARY

Some types of hardware available over SSH do not send any initial lines of data, causing network_cli to stall when connecting them.

terminal_initial_newline causes a newline character (i.e. an empty command) to be sent to the remote connection before any other processing takes place, which primes the result buffer for processing other initial prompts.

This resolves the issue and allows the module to work when speaking to devices over SSH which do this, such as serial multiplexers which are likely to be hooked up to the serial terminal ports of network hardware.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

network_cli

ADDITIONAL INFORMATION

There's no relevant command changes here, as it is seamless behind the scenes.


@pre-commit-ci pre-commit-ci bot temporarily deployed to ack October 25, 2023 05:03 Inactive
@wrouesnel wrouesnel temporarily deployed to ack October 25, 2023 05:16 — with GitHub Actions Inactive
@pre-commit-ci pre-commit-ci bot temporarily deployed to ack October 25, 2023 05:16 Inactive
@pre-commit-ci pre-commit-ci bot temporarily deployed to ack October 25, 2023 05:26 Inactive
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/97c91f7265a64ef3acdfa4e41b8a01a1

ansible-test-network-integration-junos-vsrx-netconf-python36-stable29 NODE_FAILURE Node request 200-0006545191 failed in 0s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python36-stable211 NODE_FAILURE Node request 200-0006545190 failed in 0s
ansible-test-network-integration-junos-vsrx-netconf-python39-stable212 NODE_FAILURE Node request 200-0006545189 failed in 0s
ansible-test-network-integration-junos-vsrx-netconf-python39 NODE_FAILURE Node request 200-0006545186 failed in 0s
ansible-test-network-integration-junos-vsrx-network_cli-python36-stable29 FAILURE in 17m 42s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-python36-stable211 NODE_FAILURE Node request 200-0006545183 failed in 0s
✔️ ansible-test-network-integration-junos-vsrx-network_cli-python39-stable212 SUCCESS in 15m 59s
ansible-test-network-integration-junos-vsrx-network_cli-python39 RETRY_LIMIT in 10m 01s
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable29 FAILURE in 15m 09s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable211 SUCCESS in 16m 51s
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable212 NODE_FAILURE Node request 200-0006545188 failed in 0s
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39 NODE_FAILURE Node request 200-0006545181 failed in 0s
✔️ ansible-test-network-integration-nxos-cli-python39-scenario01 SUCCESS in 29m 33s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario02 SUCCESS in 29m 12s (non-voting)
ansible-test-network-integration-nxos-cli-python39-scenario03 FAILURE in 36m 34s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario04 SUCCESS in 28m 05s (non-voting)
ansible-test-network-integration-eos-network_cli-python39 RETRY_LIMIT in 5m 46s (non-voting)
ansible-test-network-integration-eos-httpapi-python39 RETRY_LIMIT in 5m 24s (non-voting)
ansible-test-network-integration-eos-network_cli-libssh-python39 RETRY_LIMIT in 5m 24s (non-voting)
ansible-ee-integration-ios-latest NODE_FAILURE Node request 200-0006545168 failed in 0s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 15m 16s (non-voting)
ansible-ee-integration-ios-stable-2.11 NODE_FAILURE Node request 200-0006545171 failed in 0s (non-voting)
ansible-ee-integration-ios-stable-2.12 NODE_FAILURE Node request 200-0006545184 failed in 0s (non-voting)
ansible-ee-integration-ios-libssh-latest RETRY_LIMIT in 3m 24s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 14m 29s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 NODE_FAILURE Node request 200-0006545169 failed in 0s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 RETRY_LIMIT in 3m 28s (non-voting)
ansible-test-network-integration-vyos-paramiko-python39-devel NODE_FAILURE Node request 200-0006545151 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable214 NODE_FAILURE Node request 200-0006545152 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable213 NODE_FAILURE Node request 200-0006545153 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable212 NODE_FAILURE Node request 200-0006545154 failed in 0s
ansible-test-network-integration-vyos-paramiko-python36-stable29 NODE_FAILURE Node request 200-0006545155 failed in 0s (non-voting)
ansible-test-network-integration-vyos-libssh-python39-devel NODE_FAILURE Node request 200-0006545156 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable214 NODE_FAILURE Node request 200-0006545157 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable213 NODE_FAILURE Node request 200-0006545158 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable212 NODE_FAILURE Node request 200-0006545159 failed in 0s
ansible-test-network-integration-vyos-libssh-python36-stable29 NODE_FAILURE Node request 200-0006545160 failed in 0s
✔️ build-ansible-collection SUCCESS in 14m 11s
ansible-test-network-integration-ansible-netcommon-junos-vsrx-netconf-python39 RETRY_LIMIT in 8m 31s
✔️ ansible-tox-linters SUCCESS in 10m 29s
✔️ ansible-galaxy-importer SUCCESS in 5m 13s

`terminal_initial_newline`, when set to true sends a single newline
character to the remote device immediately after initially connecting.

This allows network_cli to work with some types of equipment which
fail to send any data when SSH connectivity is initially established,
such as serial-port multiplexers.
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/b6a09f557e054db49990dccf7657a5f5

ansible-test-network-integration-junos-vsrx-netconf-python36-stable29 FAILURE in 18m 15s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python36-stable211 FAILURE in 1h 31m 16s
ansible-test-network-integration-junos-vsrx-netconf-python39-stable212 FAILURE in 42m 55s
ansible-test-network-integration-junos-vsrx-netconf-python39 RETRY_LIMIT in 6m 52s
ansible-test-network-integration-junos-vsrx-network_cli-python36-stable29 FAILURE in 25m 18s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-network_cli-python36-stable211 SUCCESS in 18m 57s
✔️ ansible-test-network-integration-junos-vsrx-network_cli-python39-stable212 SUCCESS in 23m 14s
ansible-test-network-integration-junos-vsrx-network_cli-python39 RETRY_LIMIT in 10m 05s
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable29 RETRY_LIMIT in 6m 33s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable211 SUCCESS in 20m 09s
✔️ ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable212 SUCCESS in 25m 45s
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39 NODE_FAILURE Node request 200-0006639677 failed in 0s
✔️ ansible-test-network-integration-nxos-cli-python39-scenario01 SUCCESS in 31m 00s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario02 SUCCESS in 33m 26s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario03 SUCCESS in 41m 31s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario04 SUCCESS in 28m 19s (non-voting)
ansible-test-network-integration-eos-network_cli-python39 RETRY_LIMIT in 7m 13s (non-voting)
ansible-test-network-integration-eos-httpapi-python39 RETRY_LIMIT in 6m 30s (non-voting)
ansible-test-network-integration-eos-network_cli-libssh-python39 RETRY_LIMIT in 7m 13s (non-voting)
ansible-ee-integration-ios-latest RETRY_LIMIT in 6m 03s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 21m 12s (non-voting)
ansible-ee-integration-ios-stable-2.11 RETRY_LIMIT in 6m 42s (non-voting)
ansible-ee-integration-ios-stable-2.12 RETRY_LIMIT in 3m 43s (non-voting)
ansible-ee-integration-ios-libssh-latest RETRY_LIMIT in 3m 41s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 27m 22s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 RETRY_LIMIT in 6m 46s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 RETRY_LIMIT in 6m 41s (non-voting)
ansible-test-network-integration-vyos-paramiko-python39-devel NODE_FAILURE Node request 200-0006639575 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable214 NODE_FAILURE Node request 200-0006639576 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable213 NODE_FAILURE Node request 200-0006639577 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable212 NODE_FAILURE Node request 200-0006639578 failed in 0s
ansible-test-network-integration-vyos-paramiko-python36-stable29 NODE_FAILURE Node request 200-0006639579 failed in 0s (non-voting)
ansible-test-network-integration-vyos-libssh-python39-devel NODE_FAILURE Node request 200-0006639580 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable214 NODE_FAILURE Node request 200-0006639581 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable213 NODE_FAILURE Node request 200-0006639582 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable212 NODE_FAILURE Node request 200-0006639583 failed in 0s
ansible-test-network-integration-vyos-libssh-python36-stable29 NODE_FAILURE Node request 200-0006639584 failed in 0s
✔️ build-ansible-collection SUCCESS in 23m 59s
ansible-test-network-integration-ansible-netcommon-junos-vsrx-netconf-python39 NODE_FAILURE Node request 200-0006639678 failed in 0s
✔️ ansible-tox-linters SUCCESS in 21m 15s
✔️ ansible-galaxy-importer SUCCESS in 5m 22s

Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/6ccee97edb6b46e4bf2c82af294c1b14

ansible-test-network-integration-junos-vsrx-netconf-python36-stable29 FAILURE in 15m 53s (non-voting)
ansible-test-network-integration-junos-vsrx-netconf-python36-stable211 NODE_FAILURE Node request 200-0007037293 failed in 0s
✔️ ansible-test-network-integration-junos-vsrx-netconf-python39-stable212 SUCCESS in 1h 11m 17s
ansible-test-network-integration-junos-vsrx-netconf-python39 RETRY_LIMIT in 9m 32s
ansible-test-network-integration-junos-vsrx-network_cli-python36-stable29 FAILURE in 17m 25s (non-voting)
✔️ ansible-test-network-integration-junos-vsrx-network_cli-python36-stable211 SUCCESS in 18m 12s
✔️ ansible-test-network-integration-junos-vsrx-network_cli-python39-stable212 SUCCESS in 16m 28s
ansible-test-network-integration-junos-vsrx-network_cli-python39 RETRY_LIMIT in 8m 37s
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable29 FAILURE in 18m 18s (non-voting)
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable211 FAILURE in 15m 10s
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable212 NODE_FAILURE Node request 200-0007037368 failed in 0s
ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39 RETRY_LIMIT in 9m 01s
✔️ ansible-test-network-integration-nxos-cli-python39-scenario01 SUCCESS in 29m 34s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario02 SUCCESS in 28m 50s (non-voting)
ansible-test-network-integration-nxos-cli-python39-scenario03 FAILURE in 36m 09s (non-voting)
✔️ ansible-test-network-integration-nxos-cli-python39-scenario04 SUCCESS in 27m 28s (non-voting)
ansible-test-network-integration-eos-network_cli-python39 RETRY_LIMIT in 8m 53s (non-voting)
ansible-test-network-integration-eos-httpapi-python39 RETRY_LIMIT in 5m 23s (non-voting)
ansible-test-network-integration-eos-network_cli-libssh-python39 RETRY_LIMIT in 5m 29s (non-voting)
ansible-ee-integration-ios-latest RETRY_LIMIT in 3m 39s (non-voting)
ansible-ee-integration-ios-stable-2.9 FAILURE in 16m 34s (non-voting)
ansible-ee-integration-ios-stable-2.11 RETRY_LIMIT in 3m 24s (non-voting)
ansible-ee-integration-ios-stable-2.12 RETRY_LIMIT in 3m 39s (non-voting)
ansible-ee-integration-ios-libssh-latest RETRY_LIMIT in 3m 28s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.9 FAILURE in 15m 56s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.11 RETRY_LIMIT in 3m 28s (non-voting)
ansible-ee-integration-ios-libssh-stable-2.12 RETRY_LIMIT in 3m 23s (non-voting)
ansible-test-network-integration-vyos-paramiko-python39-devel NODE_FAILURE Node request 200-0007037319 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable214 NODE_FAILURE Node request 200-0007037320 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable213 NODE_FAILURE Node request 200-0007037321 failed in 0s
ansible-test-network-integration-vyos-paramiko-python39-stable212 NODE_FAILURE Node request 200-0007037322 failed in 0s
ansible-test-network-integration-vyos-paramiko-python36-stable29 NODE_FAILURE Node request 200-0007037323 failed in 0s (non-voting)
ansible-test-network-integration-vyos-libssh-python39-devel NODE_FAILURE Node request 200-0007037324 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable214 NODE_FAILURE Node request 200-0007037325 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable213 NODE_FAILURE Node request 200-0007037326 failed in 0s
ansible-test-network-integration-vyos-libssh-python39-stable212 NODE_FAILURE Node request 200-0007037327 failed in 0s
ansible-test-network-integration-vyos-libssh-python36-stable29 NODE_FAILURE Node request 200-0007037328 failed in 0s
✔️ build-ansible-collection SUCCESS in 18m 12s
ansible-test-network-integration-ansible-netcommon-junos-vsrx-netconf-python39 RETRY_LIMIT in 9m 16s
✔️ ansible-tox-linters SUCCESS in 13m 28s
✔️ ansible-galaxy-importer SUCCESS in 5m 07s

Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/62188d36a5d149f0a92d1e40943992d9

⚠️ ansible-test-network-integration-junos-vsrx-netconf-python36-stable29 SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-test-network-integration-junos-vsrx-netconf-python36-stable211 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-junos-vsrx-netconf-python39-stable212 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-junos-vsrx-netconf-python39 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-junos-vsrx-network_cli-python36-stable29 SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-test-network-integration-junos-vsrx-network_cli-python36-stable211 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-junos-vsrx-network_cli-python39-stable212 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-junos-vsrx-network_cli-python39 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable29 SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-test-network-integration-junos-vsrx-network_cli-libssh-python36-stable211 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39-stable212 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-junos-vsrx-network_cli-libssh-python39 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-vyos-paramiko-python39-devel SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-vyos-paramiko-python39-stable214 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-vyos-paramiko-python39-stable213 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-vyos-paramiko-python39-stable212 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-vyos-paramiko-python36-stable29 SKIPPED Skipped due to failed job build-ansible-collection (non-voting)
⚠️ ansible-test-network-integration-vyos-libssh-python39-devel SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-vyos-libssh-python39-stable214 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-vyos-libssh-python39-stable213 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-vyos-libssh-python39-stable212 SKIPPED Skipped due to failed job build-ansible-collection
⚠️ ansible-test-network-integration-vyos-libssh-python36-stable29 SKIPPED Skipped due to failed job build-ansible-collection
build-ansible-collection RETRY_LIMIT in 6m 51s
⚠️ ansible-test-network-integration-ansible-netcommon-junos-vsrx-netconf-python39 SKIPPED Skipped due to failed job build-ansible-collection
ansible-tox-linters RETRY_LIMIT in 8m 08s
⚠️ ansible-galaxy-importer SKIPPED Skipped due to failed job build-ansible-collection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants