Merge branch 'hot_fix_log' into dev

pull/106/head
ibuler 2016-02-29 17:59:25 +08:00
commit f6c58054a6
1 changed files with 1 additions and 5 deletions

View File

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