Skip to content
Browse files

bug 822759 - this patch reverts the initialization code for the metlo…

…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...
1 parent b7009da commit 8025b257173c994f111e38e58bc374a68ad8271f @crankycoder crankycoder committed
Showing with 27 additions and 36 deletions.
  1. +10 −6 apps/zadmin/forms.py
  2. +2 −16 sites/dev/settings_addons.py
  3. +12 −0 sites/dev/settings_base.py
  4. +3 −14 sites/dev/settings_mkt.py
View
16 apps/zadmin/forms.py
@@ -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')
View
18 sites/dev/settings_addons.py
@@ -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
View
12 sites/dev/settings_base.py
@@ -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
View
17 sites/dev/settings_mkt.py
@@ -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

0 comments on commit 8025b25

Please sign in to comment.
Something went wrong with that request. Please try again.