make rsyslog service restarts a bit less noisy

This commit is contained in:
Ryan Petrello 2020-04-14 14:18:30 -04:00
parent f5d4f7858a
commit e95938715a
No known key found for this signature in database
GPG Key ID: F2AA5F2122351777

View File

@ -29,11 +29,12 @@ def supervisor_service_command(command, service='*', communicate=True):
restart_stdout, restart_err = supervisor_process.communicate()
restart_code = supervisor_process.returncode
if restart_code or restart_err:
logger.error('supervisorctl {} errored with exit code `{}`, stdout:\n{}stderr:\n{}'.format(
command, restart_code, restart_stdout.strip(), restart_err.strip()))
logger.error('supervisorctl {} {} errored with exit code `{}`, stdout:\n{}stderr:\n{}'.format(
command, service, restart_code, restart_stdout.strip(), restart_err.strip()))
else:
logger.info('supervisorctl {} finished, stdout:\n{}'.format(
command, restart_stdout.strip()))
logger.debug(
'supervisorctl {} {} succeeded'.format(command, service)
)
else:
logger.info('Submitted supervisorctl {} command, not waiting for result'.format(command))