From 4fd6a6040245aebe6730b4d841be7112b9104a47 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 8 Aug 2019 04:49:03 -0700 Subject: [PATCH] add sentry, rename file --- Pipfile | 1 + Pipfile.lock | 24 +++++++++++++++++++++++- strpc/__init__.py | 2 +- strpc/{rpc.py => server.py} | 7 +++++-- 4 files changed, 30 insertions(+), 4 deletions(-) rename strpc/{rpc.py => server.py} (96%) diff --git a/Pipfile b/Pipfile index 5ff048d..1bc9e9c 100644 --- a/Pipfile +++ b/Pipfile @@ -7,6 +7,7 @@ verify_ssl = true [packages] sanelogging = "*" +sentry-sdk = "==0.10.2" [requires] python_version = "3.6" diff --git a/Pipfile.lock b/Pipfile.lock index 3b9689b..1ec7d73 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "d189f59cdb9acb7b516c87ead0bf88b4ebc5d7057caf2f46d4cb25e25b317035" + "sha256": "b2b160ff8a634b8c3542e2f350c55373f3090b7fccba55a8f8fcbec87ad9c3aa" }, "pipfile-spec": 6, "requires": { @@ -16,6 +16,13 @@ ] }, "default": { + "certifi": { + "hashes": [ + "sha256:046832c04d4e752f37383b628bc601a7ea7211496b4638f6514d0e5b9acc4939", + "sha256:945e3ba63a0b9f577b1395204e13c3a231f9bc0223888be653286534e5873695" + ], + "version": "==2019.6.16" + }, "colorlog": { "hashes": [ "sha256:3cf31b25cbc8f86ec01fef582ef3b840950dea414084ed19ab922c8b493f9b42", @@ -29,6 +36,21 @@ ], "index": "pypi", "version": "==1.0.1" + }, + "sentry-sdk": { + "hashes": [ + "sha256:d491aa6399eaa3eded433972751a9770180730fd8b4c225b0b7f49c4fa2af70b", + "sha256:d68003cdffbbfcadaa2c445b72e1050b0a44406f94199866f192986c016b23f5" + ], + "index": "pypi", + "version": "==0.10.2" + }, + "urllib3": { + "hashes": [ + "sha256:b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1", + "sha256:dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232" + ], + "version": "==1.25.3" } }, "develop": {} diff --git a/strpc/__init__.py b/strpc/__init__.py index f4f6c36..2922fe1 100755 --- a/strpc/__init__.py +++ b/strpc/__init__.py @@ -2,4 +2,4 @@ #234567891123456789212345678931234567894123456789512345678961234567897123456789 # encoding: utf-8 -from .rpc import STRpcRunnerService +from .server import STRpcRunnerService diff --git a/strpc/rpc.py b/strpc/server.py similarity index 96% rename from strpc/rpc.py rename to strpc/server.py index 46f87b3..1c82cb1 100755 --- a/strpc/rpc.py +++ b/strpc/server.py @@ -2,21 +2,24 @@ #234567891123456789212345678931234567894123456789512345678961234567897123456789 # encoding: utf-8 + +from .job import STRpcJob +from .utils import * from datetime import datetime, tzinfo, timedelta from sanelogging import log from time import sleep import json import os import pathlib +import sentry_sdk import socket import subprocess import uuid -from .job import STRpcJob -from .utils import * class STRpcRunnerService(object): def __init__(self): + sentry_sdk.init("https://598ba2b22ae947328590765e31e29a82@sentry.io/1525291") self.dir = os.environ.get('STRPC_BASE','/var/run/strpc') self.hostname = socket.gethostname() self.hostdir = self.dir + '/' + self.hostname