[FIX] sentry: warn about sentry_transport only if it is specified in config
parent
d438a30b7d
commit
5d3065e4af
|
@ -2,7 +2,6 @@
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
import collections
|
||||
import logging
|
||||
import warnings
|
||||
|
||||
from sentry_sdk import HttpTransport
|
||||
from sentry_sdk.consts import DEFAULT_OPTIONS
|
||||
|
@ -61,11 +60,6 @@ DEFAULT_TRANSPORT = "threaded"
|
|||
|
||||
|
||||
def select_transport(name=DEFAULT_TRANSPORT):
|
||||
warnings.warn(
|
||||
"`sentry_transport` has been deprecated. "
|
||||
"Its not neccesary send it, will use `HttpTranport` by default.",
|
||||
DeprecationWarning,
|
||||
)
|
||||
return {
|
||||
"threaded": HttpTransport,
|
||||
}.get(name, HttpTransport)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
import logging
|
||||
import warnings
|
||||
from collections import abc
|
||||
|
||||
import odoo.http
|
||||
|
@ -73,6 +74,12 @@ def initialize_sentry(config):
|
|||
"Both sentry_odoo_dir and \
|
||||
sentry_release defined, choosing sentry_release"
|
||||
)
|
||||
if config.get("sentry_transport"):
|
||||
warnings.warn(
|
||||
"`sentry_transport` has been deprecated. "
|
||||
"Its not neccesary send it, will use `HttpTranport` by default.",
|
||||
DeprecationWarning,
|
||||
)
|
||||
options = {}
|
||||
for option in const.get_sentry_options():
|
||||
value = config.get("sentry_%s" % option.key, option.default)
|
||||
|
|
Loading…
Reference in New Issue