diff options
author | Nicolas Fort <nicolasfort1988@gmail.com> | 2023-11-27 14:28:43 +0000 |
---|---|---|
committer | Nicolas Fort <nicolasfort1988@gmail.com> | 2023-11-27 14:28:43 +0000 |
commit | da83b3f96dcedaa8e4d926d9f5bdc963abd9a813 (patch) | |
tree | d947a05950ff46c81866865c552ee384915ba1e2 /src/op_mode/dhcp.py | |
parent | 6afd6eeb87a3a4ecbbd5aa9c67622d0b3c27721c (diff) | |
download | vyos-1x-da83b3f96dcedaa8e4d926d9f5bdc963abd9a813.tar.gz vyos-1x-da83b3f96dcedaa8e4d926d9f5bdc963abd9a813.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.
Diffstat (limited to 'src/op_mode/dhcp.py')
-rwxr-xr-x | src/op_mode/dhcp.py | 5 |
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 |