diff --git a/jlog/log_api.py b/jlog/log_api.py index e7e43e7e6..cce830c03 100644 --- a/jlog/log_api.py +++ b/jlog/log_api.py @@ -15,12 +15,11 @@ from struct import unpack from subprocess import Popen from sys import platform, prefix, stderr from tempfile import NamedTemporaryFile -from jumpserver.api import logger from jinja2 import FileSystemLoader, Template from jinja2.environment import Environment -from jumpserver.api import BASE_DIR +from jumpserver.api import BASE_DIR, logger from jlog.models import Log @@ -95,7 +94,6 @@ def kill_invalid_connection(): if log.login_type == 'ssh': try: os.kill(int(log.pid), 9) - except OSError: pass elif (now - log.start_time).days < 1: @@ -106,5 +104,3 @@ def kill_invalid_connection(): log.save() logger.warn('kill log %s' % log.log_path) - -