-
Notifications
You must be signed in to change notification settings - Fork 756
Fixing MSTP global command enable issue #4127
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
base: master
Are you sure you want to change the base?
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@skulambi-cisco |
|
@divyachandralekha, currently all the commands starting with "config spanning-tree mst instance" expects an entry for given instance already exists in STP_MST_INST table in config db. If an entry for the given instance does not already exist in config db, there is failure. |
@vganesan-nokia , This can be taken up as an enhancement. The current behaviour is intentional, as it prevents creating or consuming an MST instance without any VLAN mapping. This ensures that MST instances are only created when they have a valid purpose in the configuration. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@vganesan-nokia , Please approve the changes |
| vlan_str = mst_entry.get('vlan@', '') | ||
| vlan_list = format_vlan_list(vlan_str) | ||
| click.echo("") | ||
| click.echo("####### MST{:<8} Vlans mapped : {}".format(mst_id, vlan_list)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the instance is 0 we can add the word (CIST) as propsed in the HLD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take care in next PR.
| ctx.invoke(show_stp_vlan, vlanid=vlanid) | ||
| # For MSTP mode, use new format | ||
| if g_stp_mode == 'MSTP': | ||
| ctx.invoke(show_mstp_summary) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion for alternate approach:
If we can do this similar to how it is done for PVST we can show spanning tree for all MST instances and also for a specific instance (for "show spanning-tree mst instance command) using the same function show_mst_instnace_detail().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take care in next PR.
| show_mst_region_info() | ||
|
|
||
|
|
||
| def show_mst_instance_detail(mst_id): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I compare the implemented show output to the show information in HLD, I see that the information shown here is for the summary. i..e, the interface information is shown in single row for each interface. Should we rename this function to "show_mst_instance_summary()" to make the name approriately mean what is done in the function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take care in next PR.
| show_mst_port_info(mst_id, ifname) | ||
|
|
||
|
|
||
| def show_mst_port_info(mst_id, ifname): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need another function like "show_mst_port_info_detail()" which can be used for showing MST instance detail where the each port info is displayed in deatil (as per "show spanning-tree mst detail" info in the HLD)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take care in next PR.
| # CIST Root timers (typically same as bridge timers) | ||
| click.echo("CIST Root Timers : MaxAge {}s Hello {}s FwdDly {}s MaxHops {}".format( | ||
| mst_global['max_age'], mst_global['hello_time'], | ||
| mst_global['forward_delay'], mst_global['max_hops'])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommendation: It is better to implement the "show spanning-tree statistics [mst ]" as part of this PR. We already have some statistics (such as bpd rx, bpdu tx and num fwd transitions) in the STP_MST_PORT_TABLE entries. We can also implement "show spanning-tree mst interface " as part of the PR to meet all the show commands specified in HLD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems the MSTP show commands are missed during implementation.
Currently I have enhanced the existing show command to verify the MSTP. Rest all show MSTP related changes will add in next PR.
tests/test_config_mstp.py
Outdated
| assert result.exit_code != 0 | ||
| assert "Invalid value" in result.output | ||
| assert "is not one of 'enable', 'disable'" in result.output | ||
| assert "choose from enable, disable" in result.output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A generic commnent not for this line.
We need unit test for the show commands impelemented in show/stp.py.
@divyachandralekha, thanks for confirming that this is was intentional. Yes, we can do this as enhancement. |
@divyachandralekha, I have some reivew comments for the show commands implementation. I think the show command code was added after I post my previous review comments. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@vganesan-nokia , All your review comments are noted. I will take care of those in next PR. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
vganesan-nokia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for respoinding to the review comments. Looking forward to the next PR.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@qiluo-msft , Please merge the changes |
What I did
Added support to display MSTP output for "show spanning-tree" command
Fixed the issue on MSTP global enable command issue
Added testcases to cover mstp display command changes