summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicolas Fort <nicolasfort1988@gmail.com>2023-11-27 14:28:43 +0000
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2023-12-07 15:55:02 +0000
commit41b49bad0e1a17125bf1fe40bb4a0e7196f253dd (patch)
tree7cc75914f9bf4a772d2b8ef4c9c4f2e34438846b /src
parent18b2bb669bb87cde14324cbc2ae3a16d11fa578a (diff)
downloadvyos-1x-41b49bad0e1a17125bf1fe40bb4a0e7196f253dd.tar.gz
vyos-1x-41b49bad0e1a17125bf1fe40bb4a0e7196f253dd.zip
T5778: dhcp server: patch op-mode command <show dhcp server leases>. If *pool* empty, this means that lease was granted by fail-over server. Also fix issue that <show dhcp server leases state all> print nothing.
(cherry picked from commit da83b3f96dcedaa8e4d926d9f5bdc963abd9a813)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/op_mode/dhcp.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/op_mode/dhcp.py b/src/op_mode/dhcp.py
index 77f38992b..dfed2e2ed 100755
--- a/src/op_mode/dhcp.py
+++ b/src/op_mode/dhcp.py
@@ -114,8 +114,9 @@ def _get_raw_server_leases(family='inet', pool=None, sorted=None, state=[]) -> l
data_lease['remaining'] = str(data_lease["remaining"]).split('.')[0]
# Do not add old leases
- if data_lease['remaining'] != '' and data_lease['pool'] in pool and data_lease['state'] != 'free':
- if not state or data_lease['state'] in state:
+ if data_lease['remaining'] != '' and data_lease['state'] != 'free':
+ if not state or data_lease['state'] in state or state == 'all':
+ data_lease['pool'] = 'Failover-Server' if data_lease['pool'] == '' else data_lease['pool']
data.append(data_lease)
# deduplicate