Skip to content

Switchport Mode & CLI Modified Fix#3247

Merged
qiluo-msft merged 97 commits into
sonic-net:masterfrom
sabakram:Switchport_Modifed
May 10, 2024
Merged

Switchport Mode & CLI Modified Fix#3247
qiluo-msft merged 97 commits into
sonic-net:masterfrom
sabakram:Switchport_Modifed

Conversation

@sabakram

@sabakram sabakram commented Mar 28, 2024

Copy link
Copy Markdown
Contributor

What I did

This PR is Fixture for #3108 The PR was reverted due to backward compatibility issues. As per new suggestions, removed db migrator changes from this new change along with vlan.py & switchport.py changes

To Fix issues as per suggestions removed default mode from YANG model and removed minigraph changes:

How I did it

   1. Removed Db migrator changes from code. 
   2. Modified Vlan.py & Switchport.py changes 

How to verify it

New commands have been added in Command-Reference.md All the syntax and examples have been added there and they can be verified by running the specific command

@sabakram

sabakram commented Apr 2, 2024

Copy link
Copy Markdown
Contributor Author

Hi @wen587, can you please review this PR. This is in reference to PR.

We have modified code. We removed Db-migrator changes along with updated vlan.py & switchport.py to remove default "routed" mode behavior.

Comment thread config/main.py Outdated
Comment thread tests/vlan_test.py Outdated
@ridahanif96

Copy link
Copy Markdown
Contributor

Hi @theasianpianist , @prsunny @venkatmahalingam can you please help review this PR.

wen587
wen587 previously approved these changes Apr 3, 2024

@wen587 wen587 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm. Please check with other reviewer.

@ridahanif96

Copy link
Copy Markdown
Contributor

Hi @theasianpianist , @prsunny @venkatmahalingam can you please help review this PR.

Hi All,

Can you help with review this PR. Thanks.

theasianpianist
theasianpianist previously approved these changes Apr 8, 2024

@theasianpianist theasianpianist left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Vlan changes lgtm

@ridahanif96

Copy link
Copy Markdown
Contributor

Hi @prsunny & @venkatmahalingam , can you please help with review. Thanks in advance,

@prsunny

prsunny commented Apr 10, 2024

Copy link
Copy Markdown
Contributor

Can you please confirm there is no changes to existing 'show' commands? I see there is a new show CLI command which is ok.

@prsunny

prsunny commented Apr 10, 2024

Copy link
Copy Markdown
Contributor

Please confirm, this issue is fixed in this PR - sonic-net/sonic-buildimage#18392

@sabakram

Copy link
Copy Markdown
Contributor Author

Can you please confirm there is no changes to existing 'show' commands? I see there is a new show CLI command which is ok.

Hi @prsunny , we didn't make any change in exisiting show commands i.e in "show vlan brief" & "show int status". We proposed new show commands for switchport mode i.e "show int switchport config" & "show int switchport status"

@sabakram

Copy link
Copy Markdown
Contributor Author

Please confirm, this issue is fixed in this PR - sonic-net/sonic-buildimage#18392

Yes, We have checked this change with latest build. Please see behavior
ShowVersion
Cffgen_2
Cffgen_l2
Portchannel

@sabakram

Copy link
Copy Markdown
Contributor Author

Hi @wen587 Do you also suggest change for this PR in sonic_mgmt/gcu/test_vlan.py?

prsunny
prsunny previously approved these changes Apr 11, 2024
@ridahanif96

Copy link
Copy Markdown
Contributor

@venkatmahalingam Hi Venkat, can you pls help review this PR.

Comment thread utilities_common/cli.py

def vlan_range_list(ctx, vid_range: str) -> list:

vid1, vid2 = map(int, vid_range.split("-"))

@qiluo-msft qiluo-msft Apr 11, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

vid_range

will it throw if there is no "-" in vid_range? #Closed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @qiluo-msft, this function is only called if "-" is present in the argument passed to the VLAN command. If there is no "-" character in the argument provided, then it will be considered as a comma-separated list instead, not as a range. This behavior can be seen in the multiple_vlan_parser() function defined on line 289 in utilities-common/cli.py

@sabakram sabakram force-pushed the Switchport_Modifed branch from a4194c3 to 55ded95 Compare May 7, 2024 12:00
@qiluo-msft

Copy link
Copy Markdown
Contributor

Waiting on @prsunny approval.

Comment thread config/main.py

# Add a validation to check this interface is not a member in vlan before
# changing it to a router port
vlan_member_table = config_db.get_table('VLAN_MEMBER')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where is this checked now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We have added a check for switchport mode routed, a routed port fulfill this behavior that a interface has a vlan membership or not. So this check becomes redundant after addition of new check.

@qiluo-msft qiluo-msft merged commit a01a0a6 into sonic-net:master May 10, 2024
arfeigin pushed a commit to arfeigin/sonic-utilities that referenced this pull request Jun 16, 2024
This PR is Fixture for sonic-net#3108 The PR was reverted due to backward compatibility issues. As per new suggestions, removed db migrator changes from this new change along with vlan.py & switchport.py changes

To Fix issues as per suggestions removed default mode from YANG model and removed minigraph changes:

       1. Removed Db migrator changes from code.
       2. Modified Vlan.py & Switchport.py changes

New commands have been added in Command-Reference.md  All the syntax and examples have been added there and they can be verified by running the specific command
nmoray pushed a commit to nmoray/sonic-utilities that referenced this pull request Jun 25, 2025
#### What I did
This PR is Fixture for sonic-net#3108 The PR was reverted due to backward compatibility issues. As per new suggestions, removed db migrator changes from this new change along with vlan.py & switchport.py changes

To Fix issues as per suggestions removed default mode from YANG model and removed minigraph changes:

#### How I did it
       1. Removed Db migrator changes from code. 
       2. Modified Vlan.py & Switchport.py changes 

#### How to verify it
New commands have been added in Command-Reference.md  All the syntax and examples have been added there and they can be verified by running the specific command
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.

6 participants