summaryrefslogtreecommitdiffstats
path: root/python/fatcat_web/web_config.py
diff options
context:
space:
mode:
authorbnewbold <bnewbold@archive.org>2021-12-16 02:45:10 +0000
committerbnewbold <bnewbold@archive.org>2021-12-16 02:45:10 +0000
commit1632a07d581e4f17148378ebcc6fc6c162ee430a (patch)
tree192b1924f0dff0b7d9792a17a8ef58088a5c3fb8 /python/fatcat_web/web_config.py
parentb9d5c3853fe70663b0eff101c9ac4a1cbfd354e7 (diff)
parenta49df4d8f6c08ecd7a5b97a8a538b4a6f419e015 (diff)
downloadfatcat-1632a07d581e4f17148378ebcc6fc6c162ee430a.tar.gz
fatcat-1632a07d581e4f17148378ebcc6fc6c162ee430a.zip
Merge branch 'martin-sentry-sdk' into 'master'
move from raven to sentry_sdk See merge request webgroup/fatcat!135
Diffstat (limited to 'python/fatcat_web/web_config.py')
-rw-r--r--python/fatcat_web/web_config.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/python/fatcat_web/web_config.py b/python/fatcat_web/web_config.py
index 82525487..005986bd 100644
--- a/python/fatcat_web/web_config.py
+++ b/python/fatcat_web/web_config.py
@@ -12,8 +12,6 @@ import os
import subprocess
from typing import Union
-import raven
-
basedir = os.path.abspath(os.path.dirname(__file__))
@@ -44,6 +42,14 @@ def test_bool_str() -> None:
assert bool_str("True") is True
assert bool_str("FALSE") is False
+def fetch_git_sha():
+ """
+ Get short commit id, runnable anywhere within a git repository.
+ """
+ return subprocess.check_output(['git',
+ 'rev-parse',
+ '--short',
+ 'HEAD']).decode('ascii').strip()
class Config(object):
GIT_REVISION = (
@@ -137,7 +143,7 @@ class Config(object):
PERMANENT_SESSION_LIFETIME = 2678400 # 31 days, in seconds
try:
- GIT_RELEASE = raven.fetch_git_sha("..")
+ GIT_RELEASE = fetch_git_sha()
except Exception as e:
print("WARNING: couldn't set sentry git release automatically: " + str(e))
GIT_RELEASE = None