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
f992347f
Commit
f992347f
authored
Dec 28, 2017
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改become信息
parent
e2044498
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
asset.py
apps/assets/models/asset.py
+1
-5
user.py
apps/assets/models/user.py
+13
-0
No files found.
apps/assets/models/asset.py
View file @
f992347f
...
...
@@ -152,11 +152,7 @@ class Asset(models.Model):
'username'
:
admin_user
.
username
,
'password'
:
admin_user
.
password
,
'private_key'
:
admin_user
.
private_key_file
,
'become'
:
{
'method'
:
admin_user
.
become_method
,
'user'
:
admin_user
.
become_user
,
'pass'
:
admin_user
.
become_pass
,
}
'become'
:
admin_user
.
become_info
,
})
return
data
...
...
apps/assets/models/user.py
View file @
f992347f
...
...
@@ -158,6 +158,19 @@ class AdminUser(AssetUser):
def
become_pass
(
self
,
password
):
self
.
_become_pass
=
signer
.
sign
(
password
)
@property
def
become_info
(
self
):
if
self
.
become
:
info
=
{
"method"
:
self
.
become_method
,
"user"
:
self
.
become_user
,
"pass"
:
self
.
become_pass
,
}
else
:
info
=
None
return
info
def
get_related_assets
(
self
):
assets
=
[]
for
cluster
in
self
.
cluster_set
.
all
():
...
...
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