[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).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
import collections
|
import collections
|
||||||
import logging
|
import logging
|
||||||
import warnings
|
|
||||||
|
|
||||||
from sentry_sdk import HttpTransport
|
from sentry_sdk import HttpTransport
|
||||||
from sentry_sdk.consts import DEFAULT_OPTIONS
|
from sentry_sdk.consts import DEFAULT_OPTIONS
|
||||||
|
@ -61,11 +60,6 @@ DEFAULT_TRANSPORT = "threaded"
|
||||||
|
|
||||||
|
|
||||||
def select_transport(name=DEFAULT_TRANSPORT):
|
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 {
|
return {
|
||||||
"threaded": HttpTransport,
|
"threaded": HttpTransport,
|
||||||
}.get(name, HttpTransport)
|
}.get(name, HttpTransport)
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import warnings
|
||||||
from collections import abc
|
from collections import abc
|
||||||
|
|
||||||
import odoo.http
|
import odoo.http
|
||||||
|
@ -73,6 +74,12 @@ def initialize_sentry(config):
|
||||||
"Both sentry_odoo_dir and \
|
"Both sentry_odoo_dir and \
|
||||||
sentry_release defined, choosing sentry_release"
|
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 = {}
|
options = {}
|
||||||
for option in const.get_sentry_options():
|
for option in const.get_sentry_options():
|
||||||
value = config.get("sentry_%s" % option.key, option.default)
|
value = config.get("sentry_%s" % option.key, option.default)
|
||||||
|
|
Loading…
Reference in New Issue