Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
bug 822759 - this patch reverts the initialization code for the metlo…
Browse files Browse the repository at this point in the history
…g instance.

* i expect that this will cause the settings.METLOG instance to stop working in the admin.explode() page
* also reverted the use of kwargs and switched back to using local
  variables for sentry
  • Loading branch information
crankycoder committed Dec 31, 2012
1 parent b7009da commit 8025b25
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 36 deletions.
16 changes: 10 additions & 6 deletions apps/zadmin/forms.py
Expand Up @@ -329,19 +329,23 @@ class IOError(Exception):
'logger_type': 'settings.METLOG'})

elif error == 'metlog_sentry':
# These are local variables only used
# by Sentry's frame hacking magic.
# They won't be referenced which may trigger flake8
# errors.
metlog_conf = settings.METLOG_CONF # NOQA
active_metlog_conf = settings.METLOG._config # NOQA

# Try to fire off two messages to verify that we don't
# have some kind of transient issue where settings.METLOG
# doesn't work

try:
2 / 0
except:
new_metlog.raven('new_metlog: metlog_sentry error triggered',
metlog_conf=settings.METLOG_CONF,
active_metlog_conf=settings.METLOG._config,)
new_metlog.raven('new_metlog: metlog_sentry error triggered')
finally:
try:
1 / 0
except:
settings.METLOG.raven('metlog_sentry error triggered',
metlog_conf=settings.METLOG_CONF,
active_metlog_conf=settings.METLOG._config,)
settings.METLOG.raven('metlog_sentry error triggered')
18 changes: 2 additions & 16 deletions sites/dev/settings_addons.py
Expand Up @@ -80,20 +80,6 @@
LANGUAGES = lazy(lazy_langs, dict)(AMO_LANGUAGES)
LANGUAGE_URL_MAP = dict([(i.lower(), i) for i in AMO_LANGUAGES])

METLOG_CONF = {
'plugins': {'cef': ('metlog_cef.cef_plugin:config_plugin', {}),
'raven': (
'metlog_raven.raven_plugin:config_plugin', {'dsn': private_addons.SENTRY_DSN}),
},
'sender': {
'class': 'metlog.senders.UdpSender',
'host': splitstrip(private.METLOG_CONF_SENDER_HOST),
'port': private.METLOG_CONF_SENDER_PORT,
},
'logger': 'addons-dev',
}

METLOG_CONF['logger'] = 'addons-dev'
METLOG_CONF['plugins']['raven'] = ('metlog_raven.raven_plugin:config_plugin', {'dsn': private_addons.SENTRY_DSN})
METLOG = client_from_dict_config(METLOG_CONF)

USE_METLOG_FOR_CEF = True
USE_METLOG_FOR_RAVEN = False
12 changes: 12 additions & 0 deletions sites/dev/settings_base.py
Expand Up @@ -188,4 +188,16 @@

GEOIP_NOOP = 0

METLOG_CONF = {
'plugins': {'cef': ('metlog_cef.cef_plugin:config_plugin', {})},
'sender': {
'class': 'metlog.senders.UdpSender',
'host': splitstrip(private.METLOG_CONF_SENDER_HOST),
'port': private.METLOG_CONF_SENDER_PORT,
},
}

USE_METLOG_FOR_CEF = True
USE_METLOG_FOR_RAVEN = False

ALLOW_SELF_REVIEWS = True
17 changes: 3 additions & 14 deletions sites/dev/settings_mkt.py
Expand Up @@ -146,21 +146,10 @@
SIGNED_APPS_REVIEWER_SERVER_ACTIVE = True
SIGNED_APPS_REVIEWER_SERVER = private_mkt.SIGNED_APPS_REVIEWER_SERVER

METLOG_CONF = {
'plugins': {'cef': ('metlog_cef.cef_plugin:config_plugin', {}),
'raven': (
'metlog_raven.raven_plugin:config_plugin', {'dsn': SENTRY_DSN}),
},
'sender': {
'class': 'metlog.senders.UdpSender',
'host': splitstrip(private.METLOG_CONF_SENDER_HOST),
'port': private.METLOG_CONF_SENDER_PORT,
},
'logger': 'addons-marketplace-dev',
}
METLOG_CONF['logger'] = 'addons-marketplace-dev'
METLOG_CONF['plugins']['raven'] = (
'metlog_raven.raven_plugin:config_plugin', {'dsn': SENTRY_DSN})
METLOG = client_from_dict_config(METLOG_CONF)
USE_METLOG_FOR_CEF = True
USE_METLOG_FOR_RAVEN = False

WEBTRENDS_USERNAME = private_mkt.WEBTRENDS_USERNAME
WEBTRENDS_PASSWORD = private_mkt.WEBTRENDS_PASSWORD
Expand Down

0 comments on commit 8025b25

Please sign in to comment.