fix enabled logic

This commit is contained in:
Fredrik Eriksson 2024-07-21 11:28:15 +02:00
parent 8bd417de2d
commit 56901faefe
Signed by: feffe
GPG Key ID: E6B5580B853D322B

View File

@ -144,7 +144,7 @@ def restart_services():
else: else:
_ret, enabled, _err = sau.helpers.exec_cmd([ '/usr/bin/systemctl', 'is-enabled', unit ]) _ret, enabled, _err = sau.helpers.exec_cmd([ '/usr/bin/systemctl', 'is-enabled', unit ])
enabled = enabled.strip() enabled = enabled.strip()
if enabled in ('enabled', 'static'): if enabled not in ('enabled', 'static'):
log.warning(f'Unit {name}.service has enable status: {enabled} - will only restart "enabled" services') log.warning(f'Unit {name}.service has enable status: {enabled} - will only restart "enabled" services')
else: else:
service_name = name service_name = name