From c36267dc17b2c081112d51d1d7119ac59a55ff33 Mon Sep 17 00:00:00 2001 From: ibuler Date: Sun, 20 Dec 2015 19:09:18 +0800 Subject: [PATCH] rebase version --- install/install.py | 9 --------- install/next.py | 13 +++++++++++++ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/install/install.py b/install/install.py index 2200ad3e2..fabce824f 100755 --- a/install/install.py +++ b/install/install.py @@ -5,7 +5,6 @@ import subprocess import time import os import sys -import smtplib import MySQLdb from smtplib import SMTP, SMTPAuthenticationError, SMTPConnectError import ConfigParser @@ -191,14 +190,6 @@ class PreSetup(object): break print - @staticmethod - def _pull(): - color_print('开始更新jumpserver', 'green') - # bash('git pull') - os.chdir(jms_dir) - os.chmod('logs', 0777) - os.chmod('keys', 0777) - def start(self): # self._rpm_repo() # self._depend_rpm() diff --git a/install/next.py b/install/next.py index 9c3f1f652..56fe3c4f1 100755 --- a/install/next.py +++ b/install/next.py @@ -6,6 +6,7 @@ import os import django from django.core.management import execute_from_command_line import shutil +import urllib jms_dir = os.path.dirname(os.path.abspath(os.path.dirname(__file__))) sys.path.append(jms_dir) @@ -16,6 +17,7 @@ if django.get_version() != '1.6': from juser.user_api import db_add_user, get_object, User from install import color_print +from jumpserver.api import get_mac_address class Setup(object): @@ -27,6 +29,16 @@ class Setup(object): self.admin_user = 'admin' self.admin_pass = '5Lov@wife' + @staticmethod + def _pull(): + color_print('开始更新jumpserver', 'green') + # bash('git pull') + mac = get_mac_address() + version = urllib.urlopen('http://jumpserver.org/version/?id=%s' % mac) + os.chdir(jms_dir) + os.chmod('logs', 0777) + os.chmod('keys', 0777) + def _input_admin(self): while True: print @@ -75,6 +87,7 @@ class Setup(object): def start(self): print "开始安装Jumpserver, 要求环境为 CentOS 6.5 x86_64" + self._pull() self._sync_db() self._input_admin() self._create_admin()