mirror of https://github.com/jumpserver/jumpserver
fix install bug
parent
f17001e86c
commit
a7e2592fa8
|
@ -7,6 +7,7 @@ import django
|
||||||
from django.core.management import execute_from_command_line
|
from django.core.management import execute_from_command_line
|
||||||
import shutil
|
import shutil
|
||||||
import urllib
|
import urllib
|
||||||
|
import socket
|
||||||
|
|
||||||
jms_dir = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
|
jms_dir = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
|
||||||
sys.path.append(jms_dir)
|
sys.path.append(jms_dir)
|
||||||
|
@ -19,6 +20,8 @@ from juser.user_api import db_add_user, get_object, User
|
||||||
from install import color_print
|
from install import color_print
|
||||||
from jumpserver.api import get_mac_address
|
from jumpserver.api import get_mac_address
|
||||||
|
|
||||||
|
socket.setdefaulttimeout(2)
|
||||||
|
|
||||||
|
|
||||||
class Setup(object):
|
class Setup(object):
|
||||||
"""
|
"""
|
||||||
|
@ -33,8 +36,11 @@ class Setup(object):
|
||||||
def _pull():
|
def _pull():
|
||||||
color_print('开始更新jumpserver', 'green')
|
color_print('开始更新jumpserver', 'green')
|
||||||
# bash('git pull')
|
# bash('git pull')
|
||||||
|
try:
|
||||||
mac = get_mac_address()
|
mac = get_mac_address()
|
||||||
version = urllib.urlopen('http://jumpserver.org/version/?id=%s' % mac)
|
version = urllib.urlopen('http://jumpserver.org/version/?id=%s' % mac)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
os.chdir(jms_dir)
|
os.chdir(jms_dir)
|
||||||
os.chmod('logs', 0777)
|
os.chmod('logs', 0777)
|
||||||
os.chmod('keys', 0777)
|
os.chmod('keys', 0777)
|
||||||
|
|
Loading…
Reference in New Issue