|
@ -10,6 +10,8 @@ from odoo.tools import config as odoo_config |
|
|
from . import const |
|
|
from . import const |
|
|
from .logutils import LoggerNameFilter, OdooSentryHandler |
|
|
from .logutils import LoggerNameFilter, OdooSentryHandler |
|
|
|
|
|
|
|
|
|
|
|
import collections |
|
|
|
|
|
|
|
|
_logger = logging.getLogger(__name__) |
|
|
_logger = logging.getLogger(__name__) |
|
|
HAS_RAVEN = True |
|
|
HAS_RAVEN = True |
|
|
try: |
|
|
try: |
|
@ -28,7 +30,7 @@ def get_odoo_commit(odoo_dir): |
|
|
return raven.fetch_git_sha(odoo_dir) |
|
|
return raven.fetch_git_sha(odoo_dir) |
|
|
except raven.exceptions.InvalidGitRepository: |
|
|
except raven.exceptions.InvalidGitRepository: |
|
|
_logger.debug( |
|
|
_logger.debug( |
|
|
u'Odoo directory: "%s" not a valid git repository', odoo_dir) |
|
|
|
|
|
|
|
|
'Odoo directory: "%s" not a valid git repository', odoo_dir) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def initialize_raven(config, client_cls=None): |
|
|
def initialize_raven(config, client_cls=None): |
|
@ -46,7 +48,7 @@ def initialize_raven(config, client_cls=None): |
|
|
} |
|
|
} |
|
|
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) |
|
|
if callable(option.converter): |
|
|
|
|
|
|
|
|
if isinstance(option.converter, collections.Callable): |
|
|
value = option.converter(value) |
|
|
value = option.converter(value) |
|
|
options[option.key] = value |
|
|
options[option.key] = value |
|
|
|
|
|
|
|
|