'show vlan config' is not displaying the VLAN members, after the clear config and reload with default l2 configuration. #457
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
To clear configuration and load default l2 configuration, execute below commands.
redis-cli -n 4 flushdb
redis-cli -n 4 SET CONFIG_DB_INITIALIZED true
sonic-cfggen --preset l2 -H -p -k Accton-AS5712-54X >/etc/sonic/config_db.json
config reload -y
After the clear config with above commands, switch reloaded with l2 default configuration (config_samples.py).
The command 'show vlan brief' displaying the default VLAN (1000) and associated members.
But 'show vlan config' command not displaying not the VLAN information.
To fix this issue, to the default l2 configuration(config_samples.py), all ports are added as members of default VLAN. The VLAN dict is updated with members list.
- How I did it
In config_samples.py file, members are added to default Vlan(1000).
In sonic-utilities/show/main.py the VLAN information displayed correctly.
- How to verify it
Do clear config and reload switch with default l2 configuration.
check the VLAN information displayed correctly.
- Previous command output (if the output of a command-line utility has changed)
root@sonic:~# show vlan config
Name VID Member Mode
root@sonic:~#
- New command output (if the output of a command-line utility has changed)
root@sonic:~# show vlan config
Name VID Member Mode
Vlan1000 1000 Ethernet0 untagged
Vlan1000 1000 Ethernet1 untagged
Vlan1000 1000 Ethernet2 untagged
Vlan1000 1000 Ethernet3 untagged
Vlan1000 1000 Ethernet4 untagged
Vlan1000 1000 Ethernet5 untagged
.....
Vlan1000 1000 Ethernet67 untagged
Vlan1000 1000 Ethernet68 untagged
Vlan1000 1000 Ethernet69 untagged
Vlan1000 1000 Ethernet70 untagged
Vlan1000 1000 Ethernet71 untagged
root@sonic:~#