diff options
author | srividya0208 <a.srividya@vyos.io> | 2023-04-14 07:11:11 -0400 |
---|---|---|
committer | srividya0208 <a.srividya@vyos.io> | 2023-04-19 14:49:13 -0400 |
commit | e9fe5a877aa4d34cfde6e577e34146c9c025ccfa (patch) | |
tree | 5a8405b12e7e70684da7226bd67f51fa96015167 /src/op_mode | |
parent | 42775f287cca3e08dc8b2e58958018ecd1c626c9 (diff) | |
download | vyos-1x-e9fe5a877aa4d34cfde6e577e34146c9c025ccfa.tar.gz vyos-1x-e9fe5a877aa4d34cfde6e577e34146c9c025ccfa.zip |
op-mode: T5159: dhcpv6 incorrect warning message
The operational command "show dhcpv6 server leases" shows a warning message e
ven if dhcpv6 setting are configured and ipv6 address
got assigned to clients.
Diffstat (limited to 'src/op_mode')
-rwxr-xr-x | src/op_mode/dhcp.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/op_mode/dhcp.py b/src/op_mode/dhcp.py index 41da14065..fe7f252ba 100755 --- a/src/op_mode/dhcp.py +++ b/src/op_mode/dhcp.py @@ -264,8 +264,10 @@ def show_pool_statistics(raw: bool, family: ArgFamily, pool: typing.Optional[str def show_server_leases(raw: bool, family: ArgFamily, pool: typing.Optional[str], sorted: typing.Optional[str], state: typing.Optional[ArgState]): # if dhcp server is down, inactive leases may still be shown as active, so warn the user. - if not is_systemd_service_running('isc-dhcp-server.service'): - Warning('DHCP server is configured but not started. Data may be stale.') + v = '6' if family == 'inet6' else '' + service_name = 'DHCPv6' if family == 'inet6' else 'DHCP' + if not is_systemd_service_running(f'isc-dhcp-server{v}.service'): + Warning(f'{service_name} server is configured but not started. Data may be stale.') v = 'v6' if family == 'inet6' else '' if pool and pool not in _get_dhcp_pools(family=family): |