Skip to content

Add SROS show port description multiline support#2306

Open
mjbear wants to merge 2 commits into
networktocode:masterfrom
mjbear:alc_sros_sh_port_desc_issue2305
Open

Add SROS show port description multiline support#2306
mjbear wants to merge 2 commits into
networktocode:masterfrom
mjbear:alc_sros_sh_port_desc_issue2305

Conversation

@mjbear
Copy link
Copy Markdown
Collaborator

@mjbear mjbear commented Apr 9, 2026

resolves #2305

Add/fix support for alcatel_sros multiline show port description lines.

@mjbear mjbear marked this pull request as ready for review April 23, 2026 00:37
Copy link
Copy Markdown
Contributor

@matt852 matt852 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommendation: Changes Suggested

@mjbear thoughts on this agentic suggestion and how viable it is?

  • Simplify the modified header rule. The new (\s*\S*\s*\S*) group extends the match by at most two trailing tokens, so a header like Port Descriptions on Card 1 Module 2 Foo Bar would still fail to match. \s+.+ matches any trailing content and reads more clearly; tests pass locally with this change.

    In ntc_templates/templates/alcatel_sros_show_port_description.textfsm, the header rule in Start:

    -  ^Port\s+Descriptions\s+on\s\S+\s+\S+(\s*\S*\s*\S*)\s*$$ 
    +  ^Port\s+Descriptions\s+on\s+.+$$

Thanks!

@mjbear
Copy link
Copy Markdown
Collaborator Author

mjbear commented May 13, 2026

* **Simplify the modified header rule.** The new `(\s*\S*\s*\S*)` group extends the match by at most two trailing tokens,

This was designed to match the "Port Cross Connect 1" text and still be backwards compatible with two-word port names.

Port Descriptions on Port Cross Connect 1

so a header like Port Descriptions on Card 1 Module 2 Foo Bar would still fail to match. \s+.+ matches any trailing content and reads more clearly; tests pass locally with this change.

There are more words in the foo bar example than we see in actual output.

Nothing wrong with some simplification. ❤️
Maybe we don't even need to anchor on the end of the line?

(So instead of the first two, just the last one in green.)

-  ^Port\s+Descriptions\s+on\s\S+\s+\S+(\s*\S*\s*\S*)\s*$$ 
-  ^Port\s+Descriptions\s+on\s+.+$$
+  ^Port\s+Descriptions\s+on

Thank you for the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SROS22 multi-line show port description

2 participants