make reconfigure_rsyslog a task

Signed-off-by: jessicamack <jmack@redhat.com>
This commit is contained in:
jessicamack
2023-02-09 16:18:43 -05:00
committed by Hao Liu
parent b29f2f88d0
commit da004da68a
3 changed files with 9 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ from awx.main.tasks.system import clear_setting_cache
from awx.conf.models import Setting
from awx.conf.serializers import SettingCategorySerializer, SettingSingletonSerializer
from awx.conf import settings_registry
from awx.main.utils.external_logging import send_pg_notify
from awx.main.utils.external_logging import reconfigure_rsyslog
SettingCategory = collections.namedtuple('SettingCategory', ('url', 'slug', 'name'))
@@ -122,7 +122,7 @@ class SettingSingletonDetail(RetrieveUpdateDestroyAPIView):
connection.on_commit(lambda: clear_setting_cache.delay(settings_change_list))
if any([setting.startswith('LOG_AGGREGATOR') for setting in settings_change_list]):
# call notify to rsyslog. no data is need so payload is empty
send_pg_notify('rsyslog_configurer', "")
reconfigure_rsyslog.delay()
def destroy(self, request, *args, **kwargs):
instance = self.get_object()
@@ -140,7 +140,7 @@ class SettingSingletonDetail(RetrieveUpdateDestroyAPIView):
connection.on_commit(lambda: clear_setting_cache.delay(settings_change_list))
if any([setting.startswith('LOG_AGGREGATOR') for setting in settings_change_list]):
# call notify to rsyslog. no data is need so payload is empty
send_pg_notify('rsyslog_configurer', "")
reconfigure_rsyslog.delay()
# When TOWER_URL_BASE is deleted from the API, reset it to the hostname
# used to make the request as a default.