Use the existing get_receptor_ctl method (#10813)

This commit is contained in:
Alan Rominger 2021-08-04 11:02:04 -04:00
parent f47eb126e2
commit 4e84c7c4c4
No known key found for this signature in database
GPG Key ID: C2D7EAAA12B63559

View File

@ -120,8 +120,6 @@ from awx.main.analytics.subsystem_metrics import Metrics
from rest_framework.exceptions import PermissionDenied
RECEPTOR_SOCK = '/var/run/receptor/receptor.sock'
__all__ = [
'RunJob',
@ -413,7 +411,7 @@ def check_heartbeat(node):
def discover_receptor_nodes():
ctl = ReceptorControl(RECEPTOR_SOCK)
ctl = get_receptor_ctl()
connections = ctl.simple_command('status')['Advertisements']
nowtime = now()
for ad in connections:
@ -2981,9 +2979,7 @@ class AWXReceptorJob:
def run(self, work_type=None):
# We establish a connection to the Receptor socket
# TODO: Seems like we already have a method for doing this now?
# receptor_ctl = get_receptor_ctl()
receptor_ctl = ReceptorControl(RECEPTOR_SOCK)
receptor_ctl = get_receptor_ctl()
try:
return self._run_internal(receptor_ctl, work_type=work_type)