Skip to content

Commit

Permalink
Update factories.py
Browse files Browse the repository at this point in the history
Fix missing terminal config.
  • Loading branch information
romecode authored Jul 5, 2024
1 parent 62dff29 commit de68338
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/pytest_netdut/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,16 @@ def _ssh(request):
f"ssh://{request.getfixturevalue(f'{name}_hostname')}",
ssh_debug_filename=ssh_debug_file.name,
)
if ssh.cli_flavor == "mos":
# do not break the fixture if SSH failed
# pass the failure into the test
try:

# do not break the fixture if SSH failed
# pass the failure into the test
try:
if ssh.cli_flavor == "mos":
ssh.sendcmd("enable")
except AttributeError:
pass
# Disable pagination
ssh.sendcmd("terminal length 0")
except AttributeError:
pass
yield ssh

return _ssh
Expand Down

0 comments on commit de68338

Please sign in to comment.