-
Notifications
You must be signed in to change notification settings - Fork 668
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
- Loading branch information
Showing
3 changed files
with
97 additions
and
19 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
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)) |