summaryrefslogtreecommitdiff
path: root/src/op_mode
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-03-28 21:31:00 +0100
committerGitHub <noreply@github.com>2024-03-28 21:31:00 +0100
commitf30a22ebde92302916282be4fe40489efaaf3b3e (patch)
treec948506faa5ebfb53bca96ec5ae667c080a85f7a /src/op_mode
parent4412edb14062cc53ede8ac6edbc584596d8abd47 (diff)
parenta39f8c73ba6063c01e734b27a6e6a6dc72b20a2d (diff)
downloadvyos-1x-f30a22ebde92302916282be4fe40489efaaf3b3e.tar.gz
vyos-1x-f30a22ebde92302916282be4fe40489efaaf3b3e.zip
Merge pull request #3210 from sarthurdev/T6174
dhcp: T6174: Add TACACS/Radius users to _kea group
Diffstat (limited to 'src/op_mode')
-rwxr-xr-xsrc/op_mode/dhcp.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/op_mode/dhcp.py b/src/op_mode/dhcp.py
index a2f947400..f6029c748 100755
--- a/src/op_mode/dhcp.py
+++ b/src/op_mode/dhcp.py
@@ -80,14 +80,20 @@ def _get_raw_server_leases(family='inet', pool=None, sorted=None, state=[], orig
:return list
"""
inet_suffix = '6' if family == 'inet6' else '4'
- leases = kea_get_leases(inet_suffix)
+ try:
+ leases = kea_get_leases(inet_suffix)
+ except:
+ raise vyos.opmode.DataUnavailable('Cannot fetch DHCP server lease information')
if pool is None:
pool = _get_dhcp_pools(family=family)
else:
pool = [pool]
- active_config = kea_get_active_config(inet_suffix)
+ try:
+ active_config = kea_get_active_config(inet_suffix)
+ except:
+ raise vyos.opmode.DataUnavailable('Cannot fetch DHCP server configuration')
data = []
for lease in leases: