summaryrefslogtreecommitdiff
path: root/src/conf_mode/dhcp_relay.py
diff options
context:
space:
mode:
authorNicolas Fort <nicolasfort1988@gmail.com>2023-07-13 11:01:34 +0000
committerNicolas Fort <nicolasfort1988@gmail.com>2023-07-13 11:01:34 +0000
commit63f75ddbd948852f911239d672021bd5473bb16d (patch)
tree4dc4dd5f5f19801f743312c4a60a5da70a3bcf4e /src/conf_mode/dhcp_relay.py
parentac60fe7d1840b8768542ee4b3f28f46544c290f2 (diff)
downloadvyos-1x-63f75ddbd948852f911239d672021bd5473bb16d.tar.gz
vyos-1x-63f75ddbd948852f911239d672021bd5473bb16d.zip
T5059: relay: add disable options for dhcp-relay and dhcpv6-relay. Also add validor for dhcpv6-relay which was missing.
Diffstat (limited to 'src/conf_mode/dhcp_relay.py')
-rwxr-xr-xsrc/conf_mode/dhcp_relay.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/conf_mode/dhcp_relay.py b/src/conf_mode/dhcp_relay.py
index 7e702a446..7322cc571 100755
--- a/src/conf_mode/dhcp_relay.py
+++ b/src/conf_mode/dhcp_relay.py
@@ -51,7 +51,7 @@ def get_config(config=None):
def verify(relay):
# bail out early - looks like removal from running config
- if not relay:
+ if not relay or 'disable' in relay:
return None
if 'lo' in (dict_search('interface', relay) or []):
@@ -78,7 +78,7 @@ def verify(relay):
def generate(relay):
# bail out early - looks like removal from running config
- if not relay:
+ if not relay or 'disable' in relay:
return None
render(config_file, 'dhcp-relay/dhcrelay.conf.j2', relay)
@@ -87,7 +87,7 @@ def generate(relay):
def apply(relay):
# bail out early - looks like removal from running config
service_name = 'isc-dhcp-relay.service'
- if not relay:
+ if not relay or 'disable' in relay:
call(f'systemctl stop {service_name}')
if os.path.exists(config_file):
os.unlink(config_file)