osclib/sentry: provide dummy client.

This commit is contained in:
Jimmy Berry 2019-08-29 14:10:29 -05:00
parent cbfbb88048
commit eb0a6c4659

View File

@ -5,6 +5,7 @@ def sentry_init(obs_apiurl=None, tags=None):
try:
import sentry_sdk
except ImportError:
sentry_init.client = sentry_client_dummy()
return sentry_sdk_dummy()
sentry_init.client = sentry_sdk.init(
@ -43,5 +44,8 @@ class nop_class:
def __getattr__(self, _):
return nop_func
class sentry_client_dummy(nop_class):
options = {}
def nop_func(*args, **kw):
pass