Skip to content

Commit

Permalink
[vlan][dhcp_relay] Fix error while delete vlan
Browse files Browse the repository at this point in the history
  • Loading branch information
yaqiangz committed Sep 20, 2023
1 parent 701994f commit 43acc0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion config/vlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def set_dhcp_relay_table(table, config_db, vlan_name, value):


def is_dhcp_relay_running():
out, _ = clicommon.run_command("systemctl show dhcp_relay.service --property ActiveState --value", return_cmd=True)
out, _ = clicommon.run_command(["systemctl", "show", "dhcp_relay.service", "--property", "ActiveState", "--value"],
return_cmd=True)
return out.strip() == "active"

def is_dhcpv6_relay_config_exist(db, vlan_name):
Expand Down
6 changes: 3 additions & 3 deletions utilities_common/dhcp_relay_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ 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)
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():
Expand Down

0 comments on commit 43acc0d

Please sign in to comment.