1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 15:21:13 +03:00

Fixing various small issues to improve tests.

This commit is contained in:
Luke Sneeringer 2014-11-05 16:07:57 -06:00
parent 2e19b65738
commit ec55603e3f
3 changed files with 11 additions and 8 deletions

View File

@ -17,7 +17,8 @@ redis_kwargs = {}
broker_url = settings.BROKER_URL
if not broker_url.lower().startswith('redis://'):
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:]
# There may or may not be a password; address both situations by checking

View File

@ -18,9 +18,6 @@ from rest_framework.exceptions import ParseError, PermissionDenied
# PyCrypto
from Crypto.Cipher import AES
# Tower
from awx.main.queue import PubSub
__all__ = ['get_object_or_400', 'get_object_or_403', 'camelcase_to_underscore',
'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):
from awx.main.queue import PubSub
pubsub = PubSub('websocket')
payload['event'] = event
payload['endpoint'] = endpoint

View File

@ -170,10 +170,14 @@ class CallbackModule(object):
event_data['task'] = task_name
if role_name and event not in self.EVENTS_WITHOUT_TASK:
event_data['role'] = role_name
if self.callback_consumer_port:
# FIXME:
# This seems to check if anything is listening for the callback.
# 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)
# else:
# self._post_rest_api_event(event, event_data)
def on_any(self, *args, **kwargs):
pass