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

[show]: Fix show ip route result in "alias" naming mode #1327

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ghost
Copy link

@ghost ghost commented Dec 22, 2020

  • Adding case for "show ip route" command for naming mode
    "alias" to display proper result, instead of json table

Signed-off-by: Maksym Belei Maksym_Belei@jabil.com

- What I did
Resolves sonic-net/sonic-buildimage#6245
Output of command "show ip route" in cases when "naming_mode" is "alias", has fixed.

- How I did it
There is a no condition for "show ip route" command inside function "run_command_in_alias_mode" in https://github.com/Azure/sonic-utilities/blob/master/utilities_common/cli.py#L375.
The condition has added to handle "show ip route" command and return proper output result to the top level modules.

- How to verify it

  1. sudo config interface_naming_mode alias
  2. show ip route 10.0.0.12

- Previous command output

{
  "10.0.0.12\/31":[
    {
      "prefix":"10.0.0.12\/31",
      "protocol":"connected",
      "selected":true,
      "destSelected":true,
      "distance":0,
      "metric":0,
      "installed":true,
      "table":254,
      "internalStatus":16,
      "internalFlags":8,
      "internalNextHopNum":1,
      "internalNextHopActiveNum":1,
      "uptime":"1d05h50m",
      "nexthops":[
        {
          "flags":3,
          "fib":true,
          "directlyConnected":true,
          "interfaceIndex":475,
          "interfaceName":"Ethernet24",
          "active":true
        }
      ]
    }
  ]
}

- New command output

Routing entry for 10.0.0.12/31
  Known via "connected", distance 0, metric 0, best
  Last update 03:11:50 ago
  * directly connected, etp7

@ghost ghost force-pushed the fix_show_routes_in_alias_mode branch from e6ba8b8 to 8150b03 Compare December 22, 2020 19:35
@ghost
Copy link

ghost commented Dec 22, 2020

CLA assistant check
All CLA requirements met.

@ghost ghost force-pushed the fix_show_routes_in_alias_mode branch from 8150b03 to 8d54f86 Compare December 22, 2020 19:43
* Adding case for "show ip route" command for naming mode
  "alias" to display proper result, instead of json table

Signed-off-by: Maksym Belei <Maksym_Belei@jabil.com>
@ghost ghost marked this pull request as ready for review December 23, 2020 08:25
@ghost ghost changed the title [cli]: Fix running of bash commands in alias iface naming mode [show]: Fix show ip route result in "alias" naming mode Dec 23, 2020
@ghost
Copy link
Author

ghost commented Mar 23, 2021

retest this please

@ghost
Copy link
Author

ghost commented Mar 23, 2021

@anshuv-mfst, could I ask you to help me to find somebody who can review this PR?

1 similar comment
@pshulik
Copy link

pshulik commented Oct 22, 2021

@anshuv-mfst, could I ask you to help me to find somebody who can review this PR?

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.

In interface alias naming mode , show ip route <> returns json format output and doesn't show alias name.
1 participant