Skip to content
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

Juniper driver strip_context_items() suggested change #1328

Closed
shorton3 opened this issue Aug 19, 2019 · 7 comments
Closed

Juniper driver strip_context_items() suggested change #1328

shorton3 opened this issue Aug 19, 2019 · 7 comments
Labels

Comments

@shorton3
Copy link

On Juniper MX2020, the extra CLI output is just {master} or {backup}. Recommend changing:
netmiko/netmiko/juniper/juniper.py L205-206 (in your develop branch):

        r"\{master:.*\}",
        r"\{backup:.*\}",

to:
r"{master:?.}",
r"{backup:?.
}",

thank you

@carlmontanari
Copy link
Contributor

Is this applicable for all Junos versions/platforms? Also is there any scenario where the current regex would break things? Don't want to change things if we'll break anything else or its not broken!

@shorton3
Copy link
Author

I can't say for all Junos versions/platforms. My understanding is that most all Junos devices exhibit this type of extra output regarding the redundancy roles. Our Junos devices; however, display the {master} {backup} without the ":" and other extra text/digits, whereas other Junos devices output {master:0} or {backup:1}. My recommendation to add the '?' allows your pattern match to work for both {master} and {master:0}, so should work for both cases, correct?

@carlmontanari
Copy link
Contributor

Cool, yeah I think we'd end up with: \{master:?.*\} -- w/ the additional splat so the "dot" doesn't actually have to match anything. Open to a PR for it? If not no worries, and thanks for bringing it up!

@shorton3
Copy link
Author

I'm not in an environment where I can contribute; sorry. Thanks for your attention.

@georgesnow
Copy link
Contributor

if I get a chance. I can make the change and open PR for it.

@georgesnow
Copy link
Contributor

I think also this might need to be updated cause is line in reference to Linecards?:

r"\{line.*\}",

the output is actually (capital L) and the regex isn't ignoring case:
{Linecard:0}

@ktbyers ktbyers added the bug label Mar 1, 2022
@ktbyers
Copy link
Owner

ktbyers commented May 18, 2022

Fixed here:

#2787

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants