~ubuntuone-pqm-team/python-oops-celery/stable

« back to all changes in this revision

Viewing changes to oops_celery/oops_reporter.py

  • Committer: Tarmac
  • Author(s): James Westby
  • Date: 2012-02-28 19:58:11 UTC
  • mfrom: (7.1.3 serialize-task)
  • Revision ID: tarmac@server-5390-20120228195811-u5wvte6zjdpzkpoo
[r=james-w] Ensure that all oops content is bson-encodable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from celery import signals
 
2
from oops.createhooks import safe_unicode
2
3
 
3
4
 
4
5
def attach_celery_info(report, context):
38
39
        if einfo is not None:
39
40
            context['exc_info'] = einfo.exc_info
40
41
        for key, value in kwargs.items():
41
 
            context['celery.' + key] = value
 
42
            context['celery.' + key] = safe_unicode(value)
42
43
        report = self.config.create(context)
43
44
        self.config.publish(report)
44
45