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
8a87f316
Commit
8a87f316
authored
Jun 19, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 兼容之前的protocols格式
parent
2cd092af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
asset.py
apps/assets/serializers/asset.py
+4
-0
tasks.py
apps/assets/tasks.py
+2
-2
No files found.
apps/assets/serializers/asset.py
View file @
8a87f316
...
...
@@ -27,6 +27,10 @@ class ProtocolsRelatedField(serializers.RelatedField):
return
str
(
value
)
def
to_internal_value
(
self
,
data
):
print
(
data
)
print
(
type
(
data
))
if
isinstance
(
data
,
dict
):
return
data
if
'/'
not
in
data
:
raise
ValidationError
(
"protocol not contain /: {}"
.
format
(
data
))
v
=
data
.
split
(
"/"
)
...
...
apps/assets/tasks.py
View file @
8a87f316
...
...
@@ -199,7 +199,7 @@ def test_asset_connectivity_util(assets, task_name=None):
contacted
=
defaultdict
(
dict
),
dark
=
defaultdict
(
dict
),
success
=
True
)
created_by
=
assets
[
0
]
.
org_id
for
_
,
value
in
hosts_category
.
items
():
for
k
,
value
in
hosts_category
.
items
():
if
not
value
[
'hosts'
]:
continue
task
,
created
=
update_or_create_ansible_task
(
...
...
@@ -324,7 +324,7 @@ def test_system_user_connectivity_util(system_user, assets, task_name):
results_summary
=
dict
(
contacted
=
defaultdict
(
dict
),
dark
=
defaultdict
(
dict
),
success
=
True
)
for
_
,
value
in
hosts_category
.
items
():
for
k
,
value
in
hosts_category
.
items
():
if
not
value
[
'hosts'
]:
continue
task
,
created
=
update_or_create_ansible_task
(
...
...
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