Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix Mikrotik version > 6.48 = 'export' command incomplete #3405 #3467

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions netmiko/mikrotik/mikrotik_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ def disable_paging(self, *args: Any, **kwargs: Any) -> str:
"""Mikrotik does not have paging by default."""
return ""

def _prompt_handler(self, auto_find_prompt: bool) -> str:
"""Prompt regex for MikroTik is generated to match
only if the prompt string is at the end of the string
(with no more printable characters printed after it)
"""
if auto_find_prompt:
try:
prompt = self.find_prompt()
except ValueError:
prompt = self.base_prompt
else:
prompt = self.base_prompt
return re.escape(prompt.strip()) + r"[ \t]*$"

def strip_prompt(self, a_string: str) -> str:
"""Strip the trailing router prompt from the output.

Expand Down