Merge commit '546441d49920caf43eb7d33976c2d71ae85f16d5'

* commit '546441d49920caf43eb7d33976c2d71ae85f16d5':
  unify routers, add support for mysql and pgsql tasks
This commit is contained in:
Jan Dittberner 2015-01-01 22:36:22 +01:00
commit 589373a693
2 changed files with 8 additions and 16 deletions

View file

@ -1,2 +1,3 @@
.*.swp
*.pyc
.ropeproject/

View file

@ -2,23 +2,14 @@
from __future__ import unicode_literals
class LdapRouter(object):
class GvaRouter(object):
def route_for_task(self, task, args=None, kwargs=None):
if 'ldap' in task:
return {'exchange': 'ldap',
for route in ['ldap', 'file', 'mysql', 'pgsql']:
if route in task:
return {
'exchange': route,
'exchange_type': 'direct',
'queue': 'ldap'}
'queue': route,
}
return None
class FileRouter(object):
def route_for_task(self, task, args=None, kwargs=None):
if 'file' in task:
return {'exchange': 'file',
'exchange_type': 'direct',
'queue': 'file'}
return None