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

DNM check support for maintenance-mode #729

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions changelogs/fragments/add_maint_mode.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- "`ios` - add maintenance mode: to config"
2 changes: 1 addition & 1 deletion plugins/cliconf/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ def set_cli_prompt_context(self):
)

if re.search(
r"config.*\)#",
r"^.*\((?!maint-mode).*\)#$",
to_text(out, errors="surrogate_then_replace").strip(),
):
self._connection.queue_message(
Expand Down
3 changes: 2 additions & 1 deletion plugins/terminal/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ class TerminalModule(TerminalBase):
re.compile(rb"% BGP: Error initializing topology", re.I),
]

terminal_config_prompt = re.compile(r"^.+\(config(-.*)?\)#$")
terminal_config_prompt = re.compile(r"^.*\((?!maint-mode).*\)#$")
# terminal_config_prompt = re.compile(r"^.+\(config(-.*)?\)#$")

def get_privilege_level(self):
try:
Expand Down