AWX code changes for rsyslog decoupling (#13222)

* add management command and logging for new daemon
* switch tasks over to calling pg_notify
* add daemon to docker-compose and supervisor
* renamed handle_setting_changes and moved notify call
* removed initial rsyslog configure from dispatcher
* add logging and clear cache before reconfigure
* add notify to delete
* moved pg_notify to own function
* update tests impacted by rsyslog change
* changed over to new pg_notify method

Signed-off-by: Jessica Mack <jmack@redhat.com>
This commit is contained in:
jessicamack
2023-01-04 13:54:53 -05:00
committed by Hao Liu
parent c89c2892c4
commit b5e04a4cb3
9 changed files with 86 additions and 24 deletions

View File

@@ -6,6 +6,7 @@ import urllib.parse as urlparse
from django.conf import settings
from awx.main.utils.reload import supervisor_service_command
from awx.main.dispatch import pg_bus_conn
def construct_rsyslog_conf_template(settings=settings):
@@ -124,3 +125,8 @@ def reconfigure_rsyslog():
f.write(tmpl + '\n')
shutil.move(path, '/var/lib/awx/rsyslog/rsyslog.conf')
supervisor_service_command(command='restart', service='awx-rsyslogd')
def send_pg_notify(channel: str, payload: str) -> None:
with pg_bus_conn() as conn:
conn.notify(channel, payload)