Added Port-channel name validations. #556
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
- What I did
Added port-channel name validations to the configuration commands.
- How I did it
Added more Port-channel name validations to the existing pull request #436.
- How to verify it
User prompted with error for invalid port-channel configuration commands.
root@sonic:~# config portchannel add PortChan1000
Usage: config portchannel add [OPTIONS] <portchannel_name>
Error: PortChan1000 is invalid!, name should have prefix 'PortChannel' and suffix '<0-9999>'
root@sonic:~# config portchannel del PortChan1000
Usage: config portchannel del [OPTIONS] <portchannel_name>
Error: PortChan1000 is invalid!, name should have prefix 'PortChannel' and suffix '<0-9999>'
root@sonic:~# config portchannel member add PortChan1000 Ethernet0
Usage: config portchannel member add [OPTIONS] <portchannel_name> <port_name>
Error: PortChan1000 is invalid!, name should have prefix 'PortChannel' and suffix '<0-9999>'
root@sonic:~#
root@sonic:~# config portchannel member add PortChannel1 Etherne45
Usage: config portchannel member add [OPTIONS] <portchannel_name> <port_name>
Error: Interface name is invalid. Please enter a valid interface name!!
root@sonic:~#
root@sonic:~# config interface ip add PortChan1000 10.10.5.3/24
Usage: config interface ip add [OPTIONS] <interface_name> <ip_addr>
Error: 'interface_name' is not valid. Valid names [Ethernet/PortChannel/Vlan/Loopback]
root@sonic:~#