diff options
author | Daniil Baturin <daniil@vyos.io> | 2023-04-19 20:10:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-19 20:10:57 +0100 |
commit | 5da9b5122bc8545ed282692f48e307ed179225cc (patch) | |
tree | 35ac07357cb75e6027b4bf0afd2de1b36d138d3e /src/op_mode/dhcp.py | |
parent | a6499ea9d95d2b66d7977cea1d43f96d0116d4c3 (diff) | |
parent | e9fe5a877aa4d34cfde6e577e34146c9c025ccfa (diff) | |
download | vyos-1x-5da9b5122bc8545ed282692f48e307ed179225cc.tar.gz vyos-1x-5da9b5122bc8545ed282692f48e307ed179225cc.zip |
Merge pull request #1958 from srividya0208/T5159
op-mode: T5159: dhcpv6 incorrect warning message
Diffstat (limited to 'src/op_mode/dhcp.py')
-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): |