forked from sonic-net/sonic-utilities
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[vlan] Refresh dhcpv6_relay config while adding/deleting a vlan (soni…
…c-net#2660) What I did Currently, add/del a vlan doesn't change related dhcpv6_relay config, which is incorrect. How I did it 1. Add dhcp_relay table init entry while adding vlan 2. Delete dhcp_relay related config while deleting vlan 3. Add unitest How to verify it 1. By unitest 2. install whl and run cli Signed-off-by: Yaqiang Zhu <yaqiangzhu@microsoft.com>
- Loading branch information
Showing
6 changed files
with
118 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import click | ||
import utilities_common.cli as clicommon | ||
|
||
|
||
def restart_dhcp_relay_service(): | ||
""" | ||
Restart dhcp_relay service | ||
""" | ||
click.echo("Restarting DHCP relay service...") | ||
clicommon.run_command("systemctl stop dhcp_relay", display_cmd=False) | ||
clicommon.run_command("systemctl reset-failed dhcp_relay", display_cmd=False) | ||
clicommon.run_command("systemctl start dhcp_relay", display_cmd=False) | ||
|
||
|
||
def handle_restart_dhcp_relay_service(): | ||
try: | ||
restart_dhcp_relay_service() | ||
except SystemExit as e: | ||
ctx = click.get_current_context() | ||
ctx.fail("Restart service dhcp_relay failed with error {}".format(e)) |