edd6f4086c
#### Why I did it - Adapt config/show CLI commands to support DHCPv6 relay - Support multiple dhcp servers assignment in one command - Fix IP validation - Adapt UT and add new UT cases #### How I did it - Modify config/show dhcp relay files - Modify config/show UT files #### How to verify it This PR has a dependency on PR https://github.com/Azure/sonic-utilities/pull/1717 Build an image with the dependent PR and this PR Use config/show DHCPv6 relay commands.
22 lines
544 B
Python
22 lines
544 B
Python
from natsort import natsorted
|
|
import show.vlan as vlan
|
|
|
|
def get_dhcp_helper_address(ctx, vlan):
|
|
cfg, _ = ctx
|
|
vlan_dhcp_helper_data, _, _ = cfg
|
|
vlan_config = vlan_dhcp_helper_data.get(vlan)
|
|
if not vlan_config:
|
|
return ""
|
|
|
|
dhcp_helpers = vlan_config.get('dhcp_servers', [])
|
|
dhcpv6_helpers = vlan_config.get('dhcpv6_servers', [])
|
|
|
|
return '\n'.join(natsorted(dhcp_helpers) + natsorted(dhcpv6_helpers))
|
|
|
|
|
|
vlan.VlanBrief.register_column('DHCP Helper Address', get_dhcp_helper_address)
|
|
|
|
|
|
def register(cli):
|
|
pass
|