Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
2e5c01a4
Commit
2e5c01a4
authored
Feb 20, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #47 from iambocai/master
当用户未被授予任何角色/主机权限时,提示用户 根据用户实际安装路径,替换启动脚本中connect.py的路径 修正几处拼写错误
parents
19dd1af4
fa195c38
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
.gitignore
.gitignore
+1
-0
connect.py
connect.py
+6
-3
next.py
install/next.py
+2
-1
No files found.
.gitignore
View file @
2e5c01a4
...
...
@@ -37,6 +37,7 @@ nosetests.xml
.mr.developer.cfg
.project
.pydevproject
.settings
*.log
logs/*
keys/*
...
...
connect.py
View file @
2e5c01a4
...
...
@@ -582,12 +582,15 @@ class Nav(object):
role
=
role_check
[
int
(
role_id
)]
elif
len
(
roles
)
==
1
:
# 授权角色数为1
role
=
roles
[
0
]
else
:
color_print
(
'当前用户未被授予角色,无法执行任何操作,如有疑问请联系管理员。'
)
return
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
"请输入主机名或ansi
b
le支持的pattern, 多个主机:分隔, q退出"
pattern
=
raw_input
(
"
\033
[1;32mPattern>:
\033
[0m "
)
.
strip
()
if
pattern
==
'q'
:
break
...
...
@@ -629,7 +632,7 @@ class Nav(object):
self
.
user_perm
=
get_group_user_perm
(
self
.
user
)
try
:
print
"进入批量上传模式"
print
"请输入主机名或ansile支持的pattern, 多个主机:分隔 q退出"
print
"请输入主机名或ansi
b
le支持的pattern, 多个主机:分隔 q退出"
pattern
=
raw_input
(
"
\033
[1;32mPattern>:
\033
[0m "
)
.
strip
()
if
pattern
==
'q'
:
break
...
...
@@ -682,7 +685,7 @@ class Nav(object):
self
.
user_perm
=
get_group_user_perm
(
self
.
user
)
try
:
print
"进入批量下载模式"
print
"请输入主机名或ansile支持的pattern, 多个主机:分隔,q退出"
print
"请输入主机名或ansi
b
le支持的pattern, 多个主机:分隔,q退出"
pattern
=
raw_input
(
"
\033
[1;32mPattern>:
\033
[0m "
)
.
strip
()
if
pattern
==
'q'
:
break
...
...
install/next.py
View file @
2e5c01a4
...
...
@@ -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
)
...
...
@@ -84,6 +84,7 @@ class Setup(object):
def
_cp_zzsh
():
os
.
chdir
(
os
.
path
.
join
(
jms_dir
,
'install'
))
shutil
.
copy
(
'zzjumpserver.sh'
,
'/etc/profile.d/'
)
bash
(
"sed -i 's#/opt/jumpserver#
%
s#g' /etc/profile.d/zzjumpserver.sh"
%
jms_dir
)
@staticmethod
def
_run_service
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment