Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ansible-collections/ansible.netcommon
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 060d61886e08519b75091ec0f183d199a1b3f68a
Choose a base ref
..
head repository: ansible-collections/ansible.netcommon
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 79965ba194d70f50e7d8ea99292f495391490caf
Choose a head ref
Showing with 8 additions and 23 deletions.
  1. +2 −0 changelogs/fragments/terminal_initial_newline.yaml
  2. +0 −20 docs/ansible.netcommon.network_cli_connection.rst
  3. +6 −3 plugins/connection/network_cli.py
2 changes: 2 additions & 0 deletions changelogs/fragments/terminal_initial_newline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- network_cli - add `terminal_initial_newline` parameter as an option for terminal plugins.
20 changes: 0 additions & 20 deletions docs/ansible.netcommon.network_cli_connection.rst
Original file line number Diff line number Diff line change
@@ -540,26 +540,6 @@ Parameters
<div>The answer to reply with if the <code>terminal_initial_prompt</code> is matched. The value can be a single answer or a list of answers for multiple terminal_initial_prompt. In case the login menu has multiple prompts the sequence of the prompt and excepted answer should be in same order and the value of <em>terminal_prompt_checkall</em> should be set to <em>True</em> if all the values in <code>terminal_initial_prompt</code> are expected to be matched and set to <em>False</em> if any one login prompt is to be matched.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>terminal_initial_newline</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<b>Default:</b><br/><div style="color: blue">"no"</div>
</td>
<td>
<div>var: ansible_terminal_inital_newline</div>
</td>
<td>
<div>This boolean flag, that when set to <em>True</em> will send newline on initial connection establishment to the remote device.</div>
<div>This can be useful for equipment which does not send an initial header until it receives some input, like Serial-to-SSH multiplexer hardware.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
9 changes: 6 additions & 3 deletions plugins/connection/network_cli.py
Original file line number Diff line number Diff line change
@@ -667,8 +667,7 @@ def _connect(self):
)

terminal_initial_newline = (
self.get_option("terminal_initial_newline")
or self._terminal.terminal_initial_newline
self.get_option("terminal_initial_newline") or self._terminal.terminal_initial_newline
)

terminal_initial_prompt = (
@@ -684,7 +683,11 @@ def _connect(self):
check_all = self.get_option("terminal_initial_prompt_checkall") or False

if terminal_initial_newline:
self.send(command=b"", sendonly=True, newline=True)
self.send(
command=b"",
sendonly=True,
newline=True
)

self.receive(
prompts=terminal_initial_prompt,