Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
I
install.api
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
Script
install.api
Commits
66312ed4
Commit
66312ed4
authored
Apr 09, 2020
by
金凯强
🎨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
受黄总压迫,排序显示端口测试列表
parent
d51e9dc5
Pipeline
#22349
failed with stage
in 11 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
application_service.py
app/application/application_service.py
+13
-1
No files found.
app/application/application_service.py
View file @
66312ed4
...
@@ -169,9 +169,18 @@ where B.default_version=1'''
...
@@ -169,9 +169,18 @@ where B.default_version=1'''
return
app_list
return
app_list
def
test_port
(
self
,
project_no
,
json_data
):
def
test_port
(
self
,
project_no
,
json_data
):
'''
测试端口是否开放
:param project_no:
:param json_data:
:return:
'''
# 受黄总压迫,这里要排序一下
project_info
=
ConnectionService
()
.
get_project_info
(
project_no
)
project_info
=
ConnectionService
()
.
get_project_info
(
project_no
)
host_ip
=
project_info
[
'host_ip'
]
host_ip
=
project_info
[
'host_ip'
]
info_list
=
[]
info_list
=
[]
info_list_success
=
[]
info_list_fail
=
[]
for
port_info
in
json_data
:
for
port_info
in
json_data
:
info_dict
=
{}
info_dict
=
{}
info_dict
[
'port'
]
=
port_info
[
'port'
]
info_dict
[
'port'
]
=
port_info
[
'port'
]
...
@@ -179,9 +188,12 @@ where B.default_version=1'''
...
@@ -179,9 +188,12 @@ where B.default_version=1'''
try
:
try
:
self
.
test_connect_port
(
host_ip
,
port_info
[
'port'
])
self
.
test_connect_port
(
host_ip
,
port_info
[
'port'
])
info_dict
[
'status'
]
=
'测试通过'
info_dict
[
'status'
]
=
'测试通过'
info_list_success
.
append
(
info_dict
)
except
Exception
:
except
Exception
:
info_dict
[
'status'
]
=
'测试失败'
info_dict
[
'status'
]
=
'测试失败'
info_list
.
append
(
info_dict
)
info_list_fail
.
append
(
info_dict
)
# info_list.append(info_dict)
info_list
=
info_list_success
+
info_list_fail
return
info_list
return
info_list
import
timeout_decorator
import
timeout_decorator
...
...
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