rebase version

pull/26/head
ibuler 2015-12-20 19:09:18 +08:00
parent b7eb95f85f
commit c36267dc17
2 changed files with 13 additions and 9 deletions

View File

@ -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()

View File

@ -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()