Skip to content

Commit 060d618

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e7dd539 commit 060d618

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

docs/ansible.netcommon.network_cli_connection.rst

+20
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,26 @@ Parameters
540540
<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>
541541
</td>
542542
</tr>
543+
<tr>
544+
<td colspan="1">
545+
<div class="ansibleOptionAnchor" id="parameter-"></div>
546+
<b>terminal_initial_newline</b>
547+
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
548+
<div style="font-size: small">
549+
<span style="color: purple">boolean</span>
550+
</div>
551+
</td>
552+
<td>
553+
<b>Default:</b><br/><div style="color: blue">"no"</div>
554+
</td>
555+
<td>
556+
<div>var: ansible_terminal_inital_newline</div>
557+
</td>
558+
<td>
559+
<div>This boolean flag, that when set to <em>True</em> will send newline on initial connection establishment to the remote device.</div>
560+
<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>
561+
</td>
562+
</tr>
543563
<tr>
544564
<td colspan="1">
545565
<div class="ansibleOptionAnchor" id="parameter-"></div>

plugins/connection/network_cli.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,8 @@ def _connect(self):
667667
)
668668

669669
terminal_initial_newline = (
670-
self.get_option("terminal_initial_newline") or self._terminal.terminal_initial_newline
670+
self.get_option("terminal_initial_newline")
671+
or self._terminal.terminal_initial_newline
671672
)
672673

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

685686
if terminal_initial_newline:
686-
self.send(
687-
command=b"",
688-
sendonly=True,
689-
newline=True
690-
)
687+
self.send(command=b"", sendonly=True, newline=True)
691688

692689
self.receive(
693690
prompts=terminal_initial_prompt,

0 commit comments

Comments
 (0)