'Helper method to get the desired type of queue.
If no such queue is defined, default routing logic is used.'

def ensure_queue_env(self, desired_env):

    queues = getattr(settings, 'CELERY_QUEUES', None)
    return next((queue for queue in queues if ('.{}.'.format(desired_env) in queue)), None)
