Skip to content

support "show ntp" with mgmt vrf based on linux os version#858

Merged
lguohan merged 2 commits intosonic-net:masterfrom
bsun-sudo:master
Mar 25, 2020
Merged

support "show ntp" with mgmt vrf based on linux os version#858
lguohan merged 2 commits intosonic-net:masterfrom
bsun-sudo:master

Conversation

@bsun-sudo
Copy link
Copy Markdown
Contributor

@bsun-sudo bsun-sudo commented Mar 25, 2020

- What I did
When mgmt vrf is configured, "show ntp" checks Linux version to determine if to use

- cgexec -g l3mdev:mgmt ntpq -p -n --> for 4.9.0
- ip vrf exec mgmt ntpq -p -n  ---> for 4.9.0+

- How I did it
changes in show/main.py to get linux version from os.uname() and then compare with 4.9.0

- How to verify it

on 4.19.0
//////////////////////
root@sonic:/usr/lib/python2.7/dist-packages/show# show ntp
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*10.11.0.1       10.14.2.1        3 u    -   64    1    0.220  484.401   0.074
 10.11.0.2       10.14.2.1        3 u    1   64    1    0.258  481.733   0.206
root@sonic:/usr/lib/python2.7/dist-packages/show# uname -r
4.19.0-6-amd64
root@sonic:/usr/lib/python2.7/dist-packages/show#

on 4.9.0
////////////
root@sonic:/usr/lib/python2.7/dist-packages/show# show ntp
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 10.11.0.1       10.14.2.1        3 u    1   64    1    0.213   -0.423   0.069
 10.11.0.2       10.14.2.1        3 u    2   64    1    0.331   -3.644   0.433
root@sonic:/usr/lib/python2.7/dist-packages/show#
root@sonic:/usr/lib/python2.7/dist-packages/show#
root@sonic:/usr/lib/python2.7/dist-packages/show# uname -r
4.9.0-11-2-amd64

- 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)

@lguohan lguohan merged commit 51d26ce into sonic-net:master Mar 25, 2020
abdosi pushed a commit to abdosi/sonic-utilities that referenced this pull request Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants