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

[master][chassis][show-runningconfig] Fix the show runningconfiguration all issue on the Supervisor #3194

Merged

Conversation

mlok-nokia
Copy link
Contributor

What I did

bgp is not supported on Supervisor card, "show runningconfiguration all" fails on the Supervisor since the bgp services is disable. Add code to check if bgp state in the FEATURE table is able before it tries to get the BGP configuration to avoid the error. Fix issue sonic-net/sonic-buildimage#18276

How I did it

Since BGP feature state is disabled in the FEATURE table on Supervisor card, add method is_bgp_feature_state_enabled() to the bgp_util.py check the BGP feature state. Modify the "show runningconfiguration all" to call the is_bgp_feature_state_enabled(), then call the run_ngp_show _command to get the bgp configuration.

How to verify it

  1. Execute the "show runningconfiguration all" command on Supervisor. The following output should be shown without any error.
admin@ixre-cpm-chassis15:~$ show runningconfiguration all | more
{
    "localhost": {
        "AUTO_TECHSUPPORT": {
            "GLOBAL": {
                "available_mem_threshold": "10.0",
                "max_core_limit": "5.0",
                "max_techsupport_limit": "10.0",
                "min_available_mem": "200",
                "rate_limit_interval": "180",
                "since": "2 days ago",
                "state": "enabled"
            }
        },
        "AUTO_TECHSUPPORT_FEATURE": {
            "bgp": {
                "available_mem_threshold": "10.0",
                "rate_limit_interval": "600",
                "state": "enabled"
            },
            "database": {
                "available_mem_threshold": "10.0",
                "rate_limit_interval": "600",
                "state": "enabled"
            },
            "dhcp_relay": {
                "available_mem_threshold": "10.0",
                "rate_limit_interval": "600",
                "state": "enabled"
            },
            "eventd": {
                "available_mem_threshold": "10.0",
                "rate_limit_interval": "600",
                "state": "enabled"
            },
            "gnmi": {
                "available_mem_threshold": "10.0",
                "rate_limit_interval": "600",
                "state": "enabled"
            },
            "lldp": {
                "available_mem_threshold": "10.0",
                "rate_limit_interval": "600",
                "state": "enabled"
            },
....
    },
    "asic0": {
        "AUTO_TECHSUPPORT": {
            "GLOBAL": {
                "available_mem_threshold": "10.0",
                "max_core_limit": "5.0",
                "max_techsupport_limit": "10.0",
                "min_available_mem": "200",
                "rate_limit_interval": "180",
                "since": "2 days ago",
                "state": "enabled"
            }
        },
        "AUTO_TECHSUPPORT_FEATURE": {
            "bgp": {
                "available_mem_threshold": "10.0",
                "rate_limit_interval": "600",
                "state": "enabled"
            },
            "database": {
                "available_mem_threshold": "10.0",
                "rate_limit_interval": "600",
                "state": "enabled"
            },
    "asic1": {
        "AUTO_TECHSUPPORT": {
            "GLOBAL": {
                "available_mem_threshold": "10.0",
                "max_core_limit": "5.0",
                "max_techsupport_limit": "10.0",
                "min_available_mem": "200",
                "rate_limit_interval": "180",
                "since": "2 days ago",
                "state": "enabled"
            }
        },
        "AUTO_TECHSUPPORT_FEATURE": {
            "bgp": {
                "available_mem_threshold": "10.0",
                "rate_limit_interval": "600",
                "state": "enabled"
            },
            "database": {
                "available_mem_threshold": "10.0",
                "rate_limit_interval": "600",
                "state": "enabled"
            },
            "dhcp_relay": {
                "available_mem_threshold": "10.0",
...
...
    }
}

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)

…ssue on the Supervisor

Signed-off-by: mlok <marty.lok@nokia.com>
@mlok-nokia
Copy link
Contributor Author

@rlhui @judyjoseph Please review this PR for master branch.

@mlok-nokia mlok-nokia changed the title [chassis][show-runningconfig] Fix the show runningconfiguration all issue on the Supervisor [master][chassis][show-runningconfig] Fix the show runningconfiguration all issue on the Supervisor Mar 6, 2024
@mlok-nokia mlok-nokia changed the title [master][chassis][show-runningconfig] Fix the show runningconfiguration all issue on the Supervisor [chassis][show-runningconfig] Fix the show runningconfiguration all issue on the Supervisor Mar 6, 2024
@mlok-nokia mlok-nokia changed the title [chassis][show-runningconfig] Fix the show runningconfiguration all issue on the Supervisor [master][chassis][show-runningconfig] Fix the show runningconfiguration all issue on the Supervisor Mar 6, 2024
Copy link
Contributor

@wen587 wen587 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Please wait for other review's approval.

Copy link
Contributor

@judyjoseph judyjoseph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@judyjoseph judyjoseph merged commit 9d53201 into sonic-net:master Mar 14, 2024
5 checks passed
@wen587
Copy link
Contributor

wen587 commented May 30, 2024

@gechiang This PR has a bug fix and need to be backported to 202205 chassis

@gechiang
Copy link
Contributor

@gechiang This PR has a bug fix and need to be backported to 202205 chassis

@wen587 ,
Please help review this PR:
sonic-net/sonic-utilities.msft#76
which port this PR to the MSFT repo 202205 branch.

@gechiang
Copy link
Contributor

MSFT ADO: 28384064

@gechiang gechiang added the included in chassis for 202205 branch indicate that this PR got merged into the "chassis for 202205 branch" label Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chassis for 202205 Branch included in chassis for 202205 branch indicate that this PR got merged into the "chassis for 202205 branch"
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants