diff --git a/gvapgsql/gvacommon/.gitignore b/gvapgsql/gvacommon/.gitignore new file mode 100644 index 0000000..5f1ace6 --- /dev/null +++ b/gvapgsql/gvacommon/.gitignore @@ -0,0 +1,3 @@ +.*.swp +*.pyc +.ropeproject/ diff --git a/gvapgsql/gvacommon/__init__.py b/gvapgsql/gvacommon/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/gvapgsql/gvacommon/celeryrouters.py b/gvapgsql/gvacommon/celeryrouters.py new file mode 100644 index 0000000..ec7b122 --- /dev/null +++ b/gvapgsql/gvacommon/celeryrouters.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + + +class GvaRouter(object): + + def route_for_task(self, task, args=None, kwargs=None): + for route in ['ldap', 'file', 'mysql', 'pgsql']: + if route in task: + return { + 'exchange': route, + 'exchange_type': 'direct', + 'queue': route, + } + return None