-
Notifications
You must be signed in to change notification settings - Fork 399
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
Junos ping form routing instance #633
base: main
Are you sure you want to change the base?
Junos ping form routing instance #633
Conversation
* junos | ||
* Modified ping.py | ||
* Added routing instance support |
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.
Please put this changelog in the 2022/undistributed folder, the release engineer will handle putting it in this file.
"ping {addr}", | ||
"ping {addr} count {count}", | ||
"ping {addr} ttl {ttl} count {count} wait {wait}", | ||
"ping {addr} source {source} count {count}", | ||
"ping {addr} source {source} size {size} do-not-fragment count {count}", | ||
"ping {addr} source {source} size {size} count {count} tos {tos} rapid", | ||
"ping {addr} size {size} count {count} do-not-fragment", | ||
"ping {addr} routing-instance {routing_instance} count {count}", | ||
"ping {addr} routing-instance {routing_instance} source {source} count {count}" |
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.
please stop changing all the quoting, it's fine the way it is
r"^PING +(?P<address>\S+) +\((?P<source>\S+)\): +" | ||
r"(?P<data_bytes>\d+) +data +bytes$" |
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.
change the quoting back on all the patterns
@@ -198,45 +231,59 @@ def cli(self, addr, count=None, ttl=None, | |||
m = p2.match(line) or p2_2.match(line) | |||
if m: | |||
group = m.groupdict() | |||
result_list = ping_dict.setdefault('result', []) | |||
result_list = ping_dict.setdefault("result", []) |
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.
revert
continue | ||
|
||
# round-trip min/avg/max/stddev = 1.823/2.175/2.399/0.191 ms | ||
m = p4.match(line) | ||
if m: | ||
group = m.groupdict() | ||
round_trip_dict = ping_statistics_dict.setdefault('round-trip', {}) | ||
round_trip_dict.update({k.replace('_', '-'):v for k, v in group.items() if v is not None}) | ||
round_trip_dict = ping_statistics_dict.setdefault("round-trip", {}) |
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.
fix quoting
"lsping-statistics": { | ||
"send": int, | ||
"received": int, | ||
"loss-rate": int, |
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.
revert
class PingMplsRsvp(PingMplsRsvpSchema): | ||
|
||
cli_command = 'ping mpls rsvp {rsvp}' | ||
cli_command = "ping mpls rsvp {rsvp}" |
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.
revert
"ping {addr} routing-instance {routing_instance} count {count}", | ||
"ping {addr} routing-instance {routing_instance} source {source} count {count}" |
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.
You haven't added any section to the parser cli command caller that will run entry 7 or 8, making this do nothing.
Description
Added routing-instance support to the ping command. No changes to returned dictionary.
Motivation and Context
The ping command in the current release doesn't work if run from a routing-instance.
Impact (If any)
No impact.
Screenshots:
Checklist: