When mgmtvrf is enabled, the NTP vrf should be changed to "mgmt"#12
Merged
chenkelly merged 1 commit intoedge-core:202311.Xfrom Jul 30, 2024
Merged
When mgmtvrf is enabled, the NTP vrf should be changed to "mgmt"#12chenkelly merged 1 commit intoedge-core:202311.Xfrom
chenkelly merged 1 commit intoedge-core:202311.Xfrom
Conversation
Signed-off-by: irene_pan [email protected]
link19430
pushed a commit
to link19430/sonic-utilities-ec
that referenced
this pull request
Sep 4, 2024
…ng (#3030) * [fast-reboot-filter-routes.py] Remove click and improve error reporting 1. Removed click usage from a script since there is no active click context therefore we saw these error messages: ``` ERR fast-reboot-filter-routes: Got an exception There is no active click context.: Traceback: Traceback (most recent call last):edge-core#12 File "/usr/local/bin/fast-reboot-filter-routes.py", line 18, in get_connected_routes#012 output, ret = clicommon.run_command(cmd, return_cmd=True)edge-core#12 File "/usr/local/lib/python3.9/dist-packages/utilities_common/cli.py", line 545, in run_command#012 proc = subprocess.Popen(command, shell=shell, text=True, stdout=subprocess.PIPE)edge-core#12 File "/usr/lib/python3.9/subprocess.py", line 951, in __init__#012 self._execute_child(args, executable, preexec_fn, close_fds,edge-core#12 File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child#012 raise child_exception_type(errno_num, err_msg, err_filename)#012FileNotFoundError: [Errno 2] No such file or directory: 'sudo vtysh -c "show ip route connected json"'edge-core#12#012During handling of the above exception, another exception occurred:edge-core#12#012Traceback (most recent call last):edge-core#12 File "/usr/local/lib/python3.9/dist-packages/click/globals.py", line 23, in get_current_context#012 return getattr(_local, 'stack')[-1]#012AttributeError: '_thread._local' object has no attribute 'stack'edge-core#12#012During handling of the above exception, another exception occurred:edge-core#12#012Traceback (most recent call last):edge-core#12 File "/usr/local/bin/fast-reboot-filter-routes.py", line 79, in <module>edge-core#12 res = main()edge-core#12 File "/usr/local/bin/fast-reboot-filter-routes.py", line 70, in main#012 connected_routes = get_connected_routes()edge-core#12 File "/usr/local/bin/fast-reboot-filter-routes.py", line 27, in get_connected_routes#012 ctx = click.get_current_context()edge-core#12 File "/usr/local/lib/python3.9/dist-packages/click/globals.py", line 26, in get_current_context#012 raise RuntimeError('There is no active click context.')#012RuntimeError: There is no active click context. ``` 2. Improved error reporting so that when an error occurs when we run a command it will report it via terminal and syslog: stdout: ``` Failed to execute sudo vtysh -c show ip route connected jsson: % Unknown command: show ip route connected jsson ``` syslog: ``` Oct 17 11:53:10.620788 arc-switch1025 ERR fast-reboot-filter-routes: Got an exception: Failed to execute sudo vtysh -c show ip route connected jsson: % Unknown command: show ip route connected jsson: Traceback: Traceback (most recent call last):edge-core#12 File "/home/admin/fast-reboot-filter-routes.py", line 73, in <module>edge-core#12 res = main()edge-core#12 File "/home/admin/fast-reboot-filter-routes.py", line 64, in main#012 connected_routes = get_connected_routes()edge-core#12 File "/home/admin/fast-reboot-filter-routes.py", line 18, in get_connected_routes#012 raise Exception("Failed to execute {}: {}".format(" ".join(cmd), output.rstrip('\n')))#012Exception: Failed to execute sudo vtysh -c show ip route connected jsson: % Unknown command: show ip route connected jsson ``` Signed-off-by: Stepan Blyschak <[email protected]> * add a test for command failure Signed-off-by: Stepan Blyschak <[email protected]> * Increase coverage Signed-off-by: Stepan Blyschak <[email protected]> --------- Signed-off-by: Stepan Blyschak <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
#15058
Configure NTP global parameters, and specify the NTP vrf as "default".
The NTP vrf does not change to "mgmt" when mgmtvrf is enabled, causing NTP create socket to fail.
When mgmtvrf is enabled, the NTP vrf should be changed to "mgmt".
How I did it
How to verify it
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)