From a6a5abc9efb062e659c9fc94ee2182e39a42dcb6 Mon Sep 17 00:00:00 2001 From: oliver Date: Tue, 14 Jul 2026 16:49:44 +0800 Subject: [PATCH] fix(ne-exec): allow no-more in managed NE CLI pipe whitelist Support Huawei-style display ... | no-more alongside existing read-only pipe filters. Co-authored-by: Cursor --- netx_api/ne_exec.py | 2 +- tests/test_ne_exec.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/netx_api/ne_exec.py b/netx_api/ne_exec.py index b8f21be..26b2f6e 100644 --- a/netx_api/ne_exec.py +++ b/netx_api/ne_exec.py @@ -37,7 +37,7 @@ _FORBIDDEN_LINE_SEPARATORS = ("\u2028", "\u2029", "\x85", "\x0b", "\x0c") # Pipe segments allowed after show/display (output filtering only). _ALLOWED_PIPE_SEGMENT_RE = re.compile( - r"(?i)^(include|exclude|begin|section|count|match|grep|one-line)(\s|$)" + r"(?i)^(include|exclude|begin|section|count|match|grep|one-line|no-more)(\s|$)" ) _BLOCKED_PIPE_SEGMENT_RE = re.compile(r"(?i)\b(redirect|append|tee|send)\b") diff --git a/tests/test_ne_exec.py b/tests/test_ne_exec.py index 454af09..479232e 100644 --- a/tests/test_ne_exec.py +++ b/tests/test_ne_exec.py @@ -45,6 +45,7 @@ class NeExecValidationTests(unittest.TestCase): "show run | match hostname", "show run | grep hostname", "show run | one-line", + "display current-configuration | no-more", "show run | include x | include y", ): with self.subTest(cmd=cmd):