From fe5736dc7f9566fad26bcc43241e50355a391fd6 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Tue, 29 Mar 2022 13:53:59 -0400 Subject: [PATCH] Specifically abort the reaper if instance not registered --- awx/main/dispatch/reaper.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/awx/main/dispatch/reaper.py b/awx/main/dispatch/reaper.py index d256c7206f..1a1fb2a40e 100644 --- a/awx/main/dispatch/reaper.py +++ b/awx/main/dispatch/reaper.py @@ -35,9 +35,11 @@ def reap(instance=None, status='failed', excluded_uuids=[]): """ me = instance if me is None: - (changed, me) = Instance.objects.get_or_register() - if changed: - logger.info("Registered node '{}'".format(me.hostname)) + try: + me = Instance.objects.me() + except RuntimeError as e: + logger.warning(f'Local instance is not registered, not running reaper: {e}') + return now = tz_now() workflow_ctype_id = ContentType.objects.get_for_model(WorkflowJob).id jobs = UnifiedJob.objects.filter(