From 82aa12b88655ffa846304318eede2e8921f792f1 Mon Sep 17 00:00:00 2001 From: Matt Robenolt Date: Fri, 19 Apr 2019 12:02:55 -0700 Subject: [PATCH] I think fixed stuff up --- sentry.conf.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sentry.conf.py b/sentry.conf.py index f52638c..0a0fde1 100644 --- a/sentry.conf.py +++ b/sentry.conf.py @@ -49,6 +49,7 @@ # BITBUCKET_CONSUMER_KEY # BITBUCKET_CONSUMER_SECRET from sentry.conf.server import * # NOQA +from sentry.utils.types import Bool, Int import os import os.path @@ -276,12 +277,13 @@ SENTRY_WEB_OPTIONS = { ENV_CONFIG_MAPPING = { 'SENTRY_EMAIL_PASSWORD': 'mail.password', 'SENTRY_EMAIL_USER': 'mail.username', - 'SENTRY_EMAIL_PORT': ('mail.port', int), - 'SENTRY_EMAIL_USE_TLS': ('mail.use-tls', bool), + 'SENTRY_EMAIL_PORT': ('mail.port', Int), + 'SENTRY_EMAIL_USE_TLS': ('mail.use-tls', Bool), 'SENTRY_EMAIL_HOST': 'mail.host', 'SENTRY_SERVER_EMAIL': 'mail.from', 'SENTRY_ENABLE_EMAIL_REPLIES': 'mail.enable-replies', 'SENTRY_SMTP_HOSTNAME': 'mail.reply-hostname', + 'SENTRY_SECRET_KEY': 'system.secret-key', # If you're using mailgun for inbound mail, set your API key and configure a # route to forward to /api/hooks/mailgun/inbound/ @@ -299,8 +301,6 @@ ENV_CONFIG_MAPPING = { 'VSTS_CLIENT_ID': 'vsts.client-id', 'VSTS_CLIENT_SECRET': 'vsts.client-secret', - - 'SECRET_KEY': 'system.secret-key', } @@ -309,14 +309,13 @@ def bind_env_config(config=SENTRY_OPTIONS, mapping=ENV_CONFIG_MAPPING): Automatically bind SENTRY_OPTIONS from a set of environment variables. """ for env_var, item in six.iteritems(mapping): - value = env(env_var) - if value is None: + try: + value = os.environ[env_var] + except KeyError: continue if isinstance(item, tuple): opt_key, type_ = item - # only coerce the value if its not falsey (e.g. '') - if value: - value = type_(value) + value = type_(value) else: opt_key = item config[opt_key] = value