summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-01-21 09:09:01 +0100
committerChristian Breunig <christian@breunig.cc>2024-01-21 09:22:53 +0100
commit58a15d3460ba4ba1e3494d9bcb2996cd9ce8d74e (patch)
tree993d6cb7f850044d0153f49b69427fac7db2fdd2 /src/conf_mode
parent2bf2ca273165221faac559fe0d843d26dff8a18b (diff)
downloadvyos-1x-58a15d3460ba4ba1e3494d9bcb2996cd9ce8d74e.tar.gz
vyos-1x-58a15d3460ba4ba1e3494d9bcb2996cd9ce8d74e.zip
dhcp: T3316: add deprecation warning on RAW ISC DHCPD options
The following CLI nodes are deprecated and will be remove in VyOS 1.5 while moving to KEA as DHCP server. * set service dhcp-server global-parameters * set service dhcp-server shared-network-name <name> shared-network-parameters * set service dhcp-server shared-network-name <name> subnet <x.x.x.x/y> subnet-parameters Please open feature requests if any DHCP option is missing and should be added as a proper CLI node to make your life easier.
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/service_dhcp-server.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/conf_mode/service_dhcp-server.py b/src/conf_mode/service_dhcp-server.py
index 6eed2129b..341b31dd7 100755
--- a/src/conf_mode/service_dhcp-server.py
+++ b/src/conf_mode/service_dhcp-server.py
@@ -22,6 +22,7 @@ from netaddr import IPAddress
from netaddr import IPRange
from sys import exit
+from vyos.base import DeprecationWarning
from vyos.config import Config
from vyos.template import render
from vyos.utils.dict import dict_search
@@ -149,9 +150,15 @@ def verify(dhcp):
shared_networks = len(dhcp['shared_network_name'])
disabled_shared_networks = 0
+ common_deprecation_msg = 'are subject of removal in VyOS 1.5! Please raise a feature request for proper CLI nodes!'
+ if 'global_parameters' in dhcp:
+ DeprecationWarning(f'Additional global parameters {common_deprecation_msg}')
# A shared-network requires a subnet definition
for network, network_config in dhcp['shared_network_name'].items():
+ if 'shared_network_parameters' in network_config:
+ DeprecationWarning(f'Additional shared network parameters in "{network}" {common_deprecation_msg}')
+
if 'disable' in network_config:
disabled_shared_networks += 1
@@ -160,6 +167,9 @@ def verify(dhcp):
'lease subnet must be configured.')
for subnet, subnet_config in network_config['subnet'].items():
+ if 'subnet_parameters' in subnet_config:
+ DeprecationWarning(f'Additional subnet parameters in "{subnet}" {common_deprecation_msg}')
+
# All delivered static routes require a next-hop to be set
if 'static_route' in subnet_config:
for route, route_option in subnet_config['static_route'].items():