From 0b79f754f9a3632327270529d95dad98699613ed Mon Sep 17 00:00:00 2001 From: "iambocai bob.chen.cs@gmail.com" Date: Mon, 25 Jan 2016 18:21:07 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E5=BD=93=E7=94=A8=E6=88=B7=E6=9C=AA?= =?UTF-8?q?=E8=A2=AB=E6=8E=88=E4=BA=88=E4=BB=BB=E4=BD=95=E8=A7=92=E8=89=B2?= =?UTF-8?q?/=E4=B8=BB=E6=9C=BA=E6=9D=83=E9=99=90=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E7=94=A8=E6=88=B7=202.=20=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=AE=9E=E9=99=85=E5=AE=89=E8=A3=85=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=EF=BC=8C=E6=9B=BF=E6=8D=A2=E5=90=AF=E5=8A=A8=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=B8=ADconnect.py=E7=9A=84=E8=B7=AF=E5=BE=84=203.=20?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=87=A0=E5=A4=84=E6=8B=BC=E5=86=99=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .settings/org.eclipse.core.resources.prefs | 2 ++ connect.py | 8 +++++--- install/next.py | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .settings/org.eclipse.core.resources.prefs diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..1d3924f23 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/connect.py=UTF-8 diff --git a/connect.py b/connect.py index 92b2f74cc..fefa079f6 100755 --- a/connect.py +++ b/connect.py @@ -582,12 +582,14 @@ class Nav(object): role = role_check[int(role_id)] elif len(roles) == 1: # 授权角色数为1 role = roles[0] + else: + color_print('当前用户未被授予角色,无法执行任何操作,如有疑问请联系管理员。', exits=True) assets = list(self.user_perm.get('role', {}).get(role).get('asset')) # 获取该用户,角色授权主机 print "授权包含该系统用户的所有主机" for asset in assets: print ' %s' % asset.hostname print - print "请输入主机名或ansile支持的pattern, 多个主机:分隔, q退出" + print "请输入主机名或ansible支持的pattern, 多个主机:分隔, q退出" pattern = raw_input("\033[1;32mPattern>:\033[0m ").strip() if pattern == 'q': break @@ -629,7 +631,7 @@ class Nav(object): self.user_perm = get_group_user_perm(self.user) try: print "进入批量上传模式" - print "请输入主机名或ansile支持的pattern, 多个主机:分隔 q退出" + print "请输入主机名或ansible支持的pattern, 多个主机:分隔 q退出" pattern = raw_input("\033[1;32mPattern>:\033[0m ").strip() if pattern == 'q': break @@ -682,7 +684,7 @@ class Nav(object): self.user_perm = get_group_user_perm(self.user) try: print "进入批量下载模式" - print "请输入主机名或ansile支持的pattern, 多个主机:分隔,q退出" + print "请输入主机名或ansible支持的pattern, 多个主机:分隔,q退出" pattern = raw_input("\033[1;32mPattern>:\033[0m ").strip() if pattern == 'q': break diff --git a/install/next.py b/install/next.py index 62814ee67..2a8231b38 100755 --- a/install/next.py +++ b/install/next.py @@ -18,7 +18,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 +from jumpserver.api import get_mac_address, bash socket.setdefaulttimeout(2) @@ -83,6 +83,7 @@ class Setup(object): @staticmethod def _cp_zzsh(): os.chdir(os.path.join(jms_dir, 'install')) + bash("sed -i 's#/opt/jumpserver#%s#g' zzjumpserver.sh" % jms_dir) shutil.copy('zzjumpserver.sh', '/etc/profile.d/') @staticmethod