fix install bug

pull/26/head
ibuler 2015-12-21 12:18:36 +08:00
parent f17001e86c
commit a7e2592fa8
1 changed files with 8 additions and 2 deletions

View File

@ -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')
mac = get_mac_address() try:
version = urllib.urlopen('http://jumpserver.org/version/?id=%s' % mac) mac = get_mac_address()
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)