mirror of
https://github.com/ansible/awx.git
synced 2026-05-18 06:47:41 -02:30
Fixing various small issues to improve tests.
This commit is contained in:
@@ -17,7 +17,8 @@ redis_kwargs = {}
|
|||||||
broker_url = settings.BROKER_URL
|
broker_url = settings.BROKER_URL
|
||||||
if not broker_url.lower().startswith('redis://'):
|
if not broker_url.lower().startswith('redis://'):
|
||||||
raise RuntimeError('Error importing awx.main.queue: Cannot use queue with '
|
raise RuntimeError('Error importing awx.main.queue: Cannot use queue with '
|
||||||
'a non-Redis broker configured for celery.')
|
'a non-Redis broker configured for celery.\n'
|
||||||
|
'Broker is set to: %s' % broker_url)
|
||||||
broker_url = broker_url[8:]
|
broker_url = broker_url[8:]
|
||||||
|
|
||||||
# There may or may not be a password; address both situations by checking
|
# There may or may not be a password; address both situations by checking
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ from rest_framework.exceptions import ParseError, PermissionDenied
|
|||||||
# PyCrypto
|
# PyCrypto
|
||||||
from Crypto.Cipher import AES
|
from Crypto.Cipher import AES
|
||||||
|
|
||||||
# Tower
|
|
||||||
from awx.main.queue import PubSub
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['get_object_or_400', 'get_object_or_403', 'camelcase_to_underscore',
|
__all__ = ['get_object_or_400', 'get_object_or_403', 'camelcase_to_underscore',
|
||||||
'get_ansible_version', 'get_awx_version', 'update_scm_url',
|
'get_ansible_version', 'get_awx_version', 'update_scm_url',
|
||||||
@@ -364,6 +361,7 @@ def get_system_task_capacity():
|
|||||||
|
|
||||||
|
|
||||||
def emit_websocket_notification(endpoint, event, payload):
|
def emit_websocket_notification(endpoint, event, payload):
|
||||||
|
from awx.main.queue import PubSub
|
||||||
pubsub = PubSub('websocket')
|
pubsub = PubSub('websocket')
|
||||||
payload['event'] = event
|
payload['event'] = event
|
||||||
payload['endpoint'] = endpoint
|
payload['endpoint'] = endpoint
|
||||||
|
|||||||
@@ -170,10 +170,14 @@ class CallbackModule(object):
|
|||||||
event_data['task'] = task_name
|
event_data['task'] = task_name
|
||||||
if role_name and event not in self.EVENTS_WITHOUT_TASK:
|
if role_name and event not in self.EVENTS_WITHOUT_TASK:
|
||||||
event_data['role'] = role_name
|
event_data['role'] = role_name
|
||||||
if self.callback_consumer_port:
|
|
||||||
self._post_job_event_queue_msg(event, event_data)
|
# FIXME:
|
||||||
else:
|
# This seems to check if anything is listening for the callback.
|
||||||
self._post_rest_api_event(event, event_data)
|
# We probably need to duplicate this in the new Redis system.
|
||||||
|
# if self.callback_consumer_port:
|
||||||
|
self._post_job_event_queue_msg(event, event_data)
|
||||||
|
# else:
|
||||||
|
# self._post_rest_api_event(event, event_data)
|
||||||
|
|
||||||
def on_any(self, *args, **kwargs):
|
def on_any(self, *args, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user