Projet

Général

Profil

0002-debian-configure-raven-with-environment-variable-SEN.patch

Benjamin Dauvergne, 16 mars 2016 11:36

Télécharger (1,15 ko)

Voir les différences:

Subject: [PATCH 2/2] debian: configure raven with environment variable
 SENTRY_DSN (fixes #10293)

 debian/debian_config_common.py | 11 +++++++++++
 1 file changed, 11 insertions(+)
debian/debian_config_common.py
10 10

  
11 11
import os
12 12
from django.conf import global_settings
13
from django.core.exceptions import ImproperlyConfigured
13 14

  
14 15
import hobo.logger
15 16

  
......
77 78
    },
78 79
}
79 80

  
81
# Sentry support
82
if 'SENTRY_DSN' in os.environ:
83
    try:
84
        from raven.transport.requests import RequestsHTTPTransport
85
    except ImportError:
86
        raise ImproperlyConfigured('cannot configure raven, import of RequestsHTTPTransport failed')
87
    else:
88
        SENTRY_DSN = os.environ['SENTRY_DSN']
89
        SENTRY_TRANSPORT = RequestsHTTPTransport
90

  
80 91
ETC_DIR = '/etc/%s' % PROJECT_NAME
81 92
VAR_DIR = '/var/lib/%s' % PROJECT_NAME
82 93

  
83
-