Merge commit '546441d49920caf43eb7d33976c2d71ae85f16d5'
* commit '546441d49920caf43eb7d33976c2d71ae85f16d5': unify routers, add support for mysql and pgsql tasks
This commit is contained in:
commit
2e2d906f09
2 changed files with 8 additions and 16 deletions
1
gnuviechadmin/gvacommon/.gitignore
vendored
1
gnuviechadmin/gvacommon/.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
.*.swp
|
||||
*.pyc
|
||||
.ropeproject/
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue