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 <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-07-14 16:49:44 +08:00
parent 33af0efc98
commit a6a5abc9ef
2 changed files with 2 additions and 1 deletions

View file

@ -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")

View file

@ -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):