Skip to content

Commit 1acbe1e

Browse files
authored
Update factories.py (#32)
Fix missing terminal config.
1 parent 62dff29 commit 1acbe1e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/pytest_netdut/factories.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,16 @@ def _ssh(request):
322322
f"ssh://{request.getfixturevalue(f'{name}_hostname')}",
323323
ssh_debug_filename=ssh_debug_file.name,
324324
)
325-
if ssh.cli_flavor == "mos":
326-
# do not break the fixture if SSH failed
327-
# pass the failure into the test
328-
try:
325+
326+
# do not break the fixture if SSH failed
327+
# pass the failure into the test
328+
try:
329+
if ssh.cli_flavor == "mos":
329330
ssh.sendcmd("enable")
330-
except AttributeError:
331-
pass
331+
# Disable pagination
332+
ssh.sendcmd("terminal length 0")
333+
except AttributeError:
334+
pass
332335
yield ssh
333336

334337
return _ssh

0 commit comments

Comments
 (0)