Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] sentry: Fix KeyError 'with_locals' on DEFAULT_OPTIONS #3104

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sentry/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ configuration file:
Other `client arguments
<https://docs.sentry.io/platforms/python/configuration/>`_ can be
configured by prepending the argument name with *sentry_* in your Odoo config
file. Currently supported additional client arguments are: ``with_locals,
file. Currently supported additional client arguments are: ``include_local_variables,
max_breadcrumbs, release, environment, server_name, shutdown_timeout,
in_app_include, in_app_exclude, default_integrations, dist, sample_rate,
send_default_pii, http_proxy, https_proxy, request_bodies, debug,
Expand Down
2 changes: 1 addition & 1 deletion sentry/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def get_sentry_options():
SentryOption("dsn", "", str.strip),
SentryOption("transport", DEFAULT_OPTIONS["transport"], select_transport),
SentryOption("logging_level", DEFAULT_LOG_LEVEL, get_sentry_logging),
SentryOption("with_locals", DEFAULT_OPTIONS["with_locals"], None),
SentryOption("include_local_variables", DEFAULT_OPTIONS["include_local_variables"], None),
SentryOption(
"max_breadcrumbs", DEFAULT_OPTIONS["max_breadcrumbs"], to_int_if_defined
),
Expand Down
5 changes: 5 additions & 0 deletions sentry/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ def initialize_sentry(config):
"Its not neccesary send it, will use `HttpTranport` by default.",
DeprecationWarning,
)
if config.get("sentry_with_locals"):
warnings.warn(
"`with_locals` has been deprecated. "
"Use `include_local_variables` instead."
)
options = {}
for option in const.get_sentry_options():
value = config.get("sentry_%s" % option.key, option.default)
Expand Down
2 changes: 1 addition & 1 deletion sentry/readme/CONFIGURE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ configuration file:
Other `client arguments
<https://docs.sentry.io/platforms/python/configuration/>`_ can be
configured by prepending the argument name with *sentry_* in your Odoo config
file. Currently supported additional client arguments are: ``with_locals,
file. Currently supported additional client arguments are: ``include_local_variables,
max_breadcrumbs, release, environment, server_name, shutdown_timeout,
in_app_include, in_app_exclude, default_integrations, dist, sample_rate,
send_default_pii, http_proxy, https_proxy, request_bodies, debug,
Expand Down
2 changes: 1 addition & 1 deletion sentry/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Configuration</a></h1>
</table>
<p>Other <a class="reference external" href="https://docs.sentry.io/platforms/python/configuration/">client arguments</a> can be
configured by prepending the argument name with <em>sentry_</em> in your Odoo config
file. Currently supported additional client arguments are: <tt class="docutils literal">with_locals,
file. Currently supported additional client arguments are: <tt class="docutils literal">include_local_variables,
max_breadcrumbs, release, environment, server_name, shutdown_timeout,
in_app_include, in_app_exclude, default_integrations, dist, sample_rate,
send_default_pii, http_proxy, https_proxy, request_bodies, debug,
Expand Down
Loading