Skip to content

Add show suppress-fib-pending code#189

Closed
meghna-mishra wants to merge 9 commits intoAzure:kubesonicfrom
meghna-mishra:addSuppressFibPendingCode
Closed

Add show suppress-fib-pending code#189
meghna-mishra wants to merge 9 commits intoAzure:kubesonicfrom
meghna-mishra:addSuppressFibPendingCode

Conversation

@meghna-mishra
Copy link
Copy Markdown

@meghna-mishra meghna-mishra commented Mar 18, 2026

Why I did it

Added gNMI getter for show suppress-fib-pending so client can fetch value (enabled or disabled) of suppress-fib-pending feature via gNMI in JSON format.

How I did it

Wrote function getSuppressFibPending() which fetches the value of suppress-fib-pending key in localhost if set, and defaults to 'Disabled' if not.

(SHOW command specific) What sources are you using to fetch data?

CONFIG_DB, specifically DEVICE_METADATA|localhost.

How to verify it (Please provide snapshot of diff coverage from CI pipeline)

(Show command specific) Output of show CLI that is equivalent to API output

When value is not set:

admin@bjw2-can-4600c-6:~$ redis-cli -n 4 hdel "DEVICE_METADATA|localhost" suppress-fib-pending
(integer) 1
admin@bjw2-can-4600c-6:~$ show suppress-fib-pending
Enabled

When value is set to Enabled:

admin@bjw2-can-4600c-6:~$ redis-cli -n 4 hset "DEVICE_METADATA|localhost" suppress-fib-pending enabled
(integer) 1

When value is set to Disabled:

admin@bjw2-can-4600c-6:~$ redis-cli -n 4 hset "DEVICE_METADATA|localhost" suppress-fib-pending disabled
(integer) 0
admin@bjw2-can-4600c-6:~$ show suppress-fib-pending
Disabled

Manual test output of API on device (Please provide output from device that you have tested your changes on)

When value is not set:

root@bjw2-can-4600c-6:/# gnmi_get -xpath_target SHOW -xpath suppress-fib-pending -target_addr 127.0.0.1:50051 -logtostderr -insecure true
== getRequest:
prefix: <
  target: "SHOW"
>
path: <
  elem: <
    name: "suppress-fib-pending"
  >
>
encoding: JSON_IETF

== getResponse:
notification: <
  timestamp: 1775474687515147246
  prefix: <
    target: "SHOW"
  >
  update: <
    path: <
      elem: <
        name: "suppress-fib-pending"
      >
    >
    val: <
      json_ietf_val: "{\"status\":\"Enabled\"}"
    >
  >
>

root@bjw2-can-4600c-6:/#

When value is set to Disabled:

root@bjw2-can-4600c-6:/# gnmi_get -xpath_target SHOW -xpath suppress-fib-pending -target_addr 127.0.0.1:50051 -logtostderr -insecure true
== getRequest:
prefix: <
  target: "SHOW"
>
path: <
  elem: <
    name: "suppress-fib-pending"
  >
>
encoding: JSON_IETF

== getResponse:
notification: <
  timestamp: 1775474720214135115
  prefix: <
    target: "SHOW"
  >
  update: <
    path: <
      elem: <
        name: "suppress-fib-pending"
      >
    >
    val: <
      json_ietf_val: "{\"status\":\"Disabled\"}"
    >
  >
>

When value is set to Enabled:

root@bjw2-can-4600c-6:/# gnmi_get -xpath_target SHOW -xpath suppress-fib-pending -target_addr 127.0.0.1:50051 -logtostderr -insecure true
== getRequest:
prefix: <
  target: "SHOW"
>
path: <
  elem: <
    name: "suppress-fib-pending"
  >
>
encoding: JSON_IETF

== getResponse:
notification: <
  timestamp: 1775474299946142048
  prefix: <
    target: "SHOW"
  >
  update: <
    path: <
      elem: <
        name: "suppress-fib-pending"
      >
    >
    val: <
      json_ietf_val: "{\"status\":\"Enabled\"}"
    >
  >
>

NOTE: Differences in code based on SONiC versions

Different versions of SONiC deployments corresponding to different sonic-utilities branches, had changes in what the value returned should be when suppress_fib_pending is not set in DB. For some branches/releases I saw 'Enabled' and some had 'Disabled' as default value.

-- Public Branch --
BR [202411]: default is "disabled"
BR [202511]: default is "enabled"
BR [master]: default is "enabled"
-- MSFT Branch --
BR [202412]: default is "disabled"
BR [master]: default is "disabled"

Public code location on master: https://github.com/sonic-net/sonic-utilities/blob/0024c8d432bb69db3216bd1708d324f3f2397f3b/show/main.py#L2755
MSFT code location on master: https://github.com/Azure/sonic-utilities.msft/blob/3fb3258806c25b8d60a255ce0508dcd20018bdc6/show/main.py#L2104-L2105

MSFT looks like in sync with 202411, but from 202511 the default values is changed on public. In order to maintain parity with public repo, the default is set to 'Enabled' here.

A picture of a cute animal (not mandatory but encouraged)

image

zbud-msft and others added 4 commits March 10, 2026 01:35
Signed-off-by: Zain Budhwani <zainbudhwani@microsoft.com>
Merge all SHOW commands work into master and necessary changes to make them work with master branch's current infrastructure and dependencies.
@meghna-mishra meghna-mishra changed the title Add suppress fib pending code Add show suppress-fib-pending code Mar 18, 2026
@meghna-mishra
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@meghna-mishra
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@meghna-mishra
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Deepak-Pandey
Deepak-Pandey previously approved these changes Mar 18, 2026
zbud-msft and others added 2 commits March 25, 2026 14:58
<!--
Please make sure you've read and understood our contributing guidelines:
     https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

** Make sure all your commits include a signature generated with `git
commit -s` **

If this is a bug fix, make sure your description includes "fixes #xxxx",
or
     "closes #xxxx" or "resolves #xxxx"

     Please provide the following information:
-->

#### Why I did it

Sync master sonic-gnmi and master in sonic-gnmi.msft

#### How I did it

#### How to verify it

#### Which release branch to backport (provide reason below if selected)

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111

#### Description for the changelog
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on
https://github.com/Azure/SONiC/wiki/Configuration.
-->

#### A picture of a cute animal (not mandatory but encouraged)

---------

Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
Signed-off-by: kanchanavelusamy <velusamyk@google.com>
Signed-off-by: Niranjani Vivek <niranjaniv@google.com>
Co-authored-by: Dawei Huang <daweihuang@microsoft.com>
Co-authored-by: niranjanivivek <niranjaniv@google.com>
Co-authored-by: kanchanavelusamy <velusamyk@google.com>
Co-authored-by: Rustiqly (agent of lihuay) <245760149+rustiqly@users.noreply.github.com>
Co-authored-by: sigabrtv1 <sig.abrt.v1@gmail.com>
@meghna-mishra meghna-mishra changed the base branch from master to kubesonic April 6, 2026 11:31
@meghna-mishra meghna-mishra dismissed Deepak-Pandey’s stale review April 6, 2026 11:31

The base branch was changed.

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.

3 participants