Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

False positives on _base_pattern, can't override. #50

@spdkils

Description

@spdkils

Describe the bug

The send_command function allows for a pattern to be input to stop the parse, however the default pattern is used as an optional stop point regardless.

This causes issues if you have a comment with the switch name and a > or # following it.

The regular expression should probably be anchored ^ $ to confirm that it is not found in the middle of a line, or other erronous location causing the send_command to prematurely return.

General Information

  • WIN
  • Netdev version 9.3
  • Base.py

Debug information

Reading pattern "WAS-SF02-1-119-DC#" or "WAS-SF02-1-1.?((.?))?[>|#]" was found

^^^^ WHOOOPS!!!

My startup has this line...

description VPC Peerlink<Chassis1 WAS-SF01-1-119-DC | Chassis2 WAS-SF02-1-119-DC>

Additional context

So, without line anchors, I have to limit what descriptions I have, and I'm not sure if it's catching a truncating other commands.

The fix???

Well there are a few approaches. First if I override a pattern, it should respect that pattern, and timeout otherwise, not use both my pattern and the default pattern.

Second I think anchors in most cases would be appropriate to ensure the base prompt is found on a "clean" line, not as a mishap of some port description if I have some network admin getting fancy with their descriptions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions