Skip to content

Commit cc4058f

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

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

docs/ansible.netcommon.network_cli_connection.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,26 @@ Parameters
502502
<div>When set to <code>ignore</code>, the errors are silently ignored. When set to <code>warn</code>, a warning message is displayed. The default option <code>fail</code>, triggers a failure and halts execution.</div>
503503
</td>
504504
</tr>
505+
<tr>
506+
<td colspan="1">
507+
<div class="ansibleOptionAnchor" id="parameter-"></div>
508+
<b>terminal_inital_newline</b>
509+
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
510+
<div style="font-size: small">
511+
<span style="color: purple">boolean</span>
512+
</div>
513+
</td>
514+
<td>
515+
<b>Default:</b><br/><div style="color: blue">"no"</div>
516+
</td>
517+
<td>
518+
<div>var: ansible_terminal_inital_newline</div>
519+
</td>
520+
<td>
521+
<div>This boolean flag, that when set to <em>True</em> will send newline on initial connection establishment to the remote device.</div>
522+
<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>
523+
</td>
524+
</tr>
505525
<tr>
506526
<td colspan="1">
507527
<div class="ansibleOptionAnchor" id="parameter-"></div>

plugins/connection/network_cli.py

Lines changed: 3 additions & 6 deletions
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)