ceph/teuthology/sentry.py

19 lines
288 B
Python
Raw Normal View History

2013-08-23 16:40:22 +00:00
import logging
2013-08-21 15:07:12 +00:00
from raven import Client
2013-08-23 16:40:22 +00:00
from .config import config
log = logging.getLogger(__name__)
2013-08-21 15:07:12 +00:00
client = None
2013-08-23 16:40:22 +00:00
def get_client():
2013-08-21 15:27:51 +00:00
global client
2013-08-21 15:07:12 +00:00
if client:
return client
2013-08-23 16:40:22 +00:00
dsn = config.sentry_dsn
2013-08-21 15:07:12 +00:00
if dsn:
client = Client(dsn=dsn)
return client