-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add support for Huawei VRP CLI #170
Conversation
channel/channel.go
Outdated
@@ -37,7 +37,7 @@ var ( | |||
|
|||
func getPromptPattern() *regexp.Regexp { | |||
promptPatternOnce.Do(func() { | |||
promptPattern = regexp.MustCompile(`(?im)^[a-z\d.\-@()/:]{1,48}[#>$]\s*$`) | |||
promptPattern = regexp.MustCompile(`(?im)^<*[a-z\d.\-@()/:]{1,48}[#>$]\s*$`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, im guessing this is since we would fail to match in authenticate step without the <
char? I think we "should" be using the combined pattern from the network driver before open/auth in the channel happens. on driver creation here we should be basically joining all the priv levels into one big pattern and setting that on the channel. is this not happening/working right?
if its not working right id like to fix that and then nix adding the <
here just since this pattern hasn't otherwise changed in a long time (going back to scrapli python early days).
as an aside this pattern is terribly inefficient (the way I set it up, nothing you did!)... but thats a problem for another day...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, forgot to mention this change, but this is in order to get the generic driver working, without it it just times out waiting for a prompt that never matches since the huawei prompt has a < in the beginning and not just a > at the end of the prompt.
That said I only really used the generic driver at first before making a driver for VRP so I'm ok with removing it too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, yeah that makes sense! lets go ahead and remove this and the extra commented stuff in the platform and we'll get it merged! I can do that this weekend if ya don't get to it before me!
👋 hey @wwijkander thanks for the work here! looks good to me - just left a few little comments to discuss then we can get it all merged! thanks a bunch! |
ah seems I can't push to your pr for whatever reason -- so if you wanna get those comments cleared out and revert that base pattern stuff like discussed whenever ya have a sec ill get this merged. have a nice weekend! |
Hope you had a good weekend! I kind of lost this in other stuff but I pushed a new commit now. Left the comments about the error message as it might look like a typo otherwise. Cheers! |
assets/platforms/huawei_vrp.yaml
Outdated
textfsm-platform: 'huawei_vrp' # ignored in go because no ntc-templates | ||
network-on-open: | ||
- operation: 'acquire-priv' # targets default desired priv by default | ||
# - operation: 'driver.send-command' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we get rid of these commented lines, looks like they're not necessary?
channel/channel.go
Outdated
@@ -37,7 +37,7 @@ var ( | |||
|
|||
func getPromptPattern() *regexp.Regexp { | |||
promptPatternOnce.Do(func() { | |||
promptPattern = regexp.MustCompile(`(?im)^[a-z\d.\-@()/:]{1,48}[#>$]\s*$`) | |||
promptPattern = regexp.MustCompile(`(?im)^<*[a-z\d.\-@()/:]{1,48}[#>$]\s*$`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, yeah that makes sense! lets go ahead and remove this and the extra commented stuff in the platform and we'll get it merged! I can do that this weekend if ya don't get to it before me!
Add support for Huawei VRP CLI. A CLI session looks like this: