Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
backend_auto
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
邓莹莹
backend_auto
Commits
fd86ee51
Commit
fd86ee51
authored
May 18, 2021
by
肖伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
动态获取host
parent
32e62b08
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
host.yaml
host.yaml
+1
-1
base_request.py
in_common/base_request.py
+14
-5
No files found.
host.yaml
View file @
fd86ee51
develop_host
:
backend
:
http://backend.paas-develop.env
#
doctor: http://doctor.paas-develop.env
doctor
:
http://doctor.paas-develop.env
in_common/base_request.py
View file @
fd86ee51
...
...
@@ -63,11 +63,20 @@ class BaseRequest:
def
api_send
(
self
,
req
:
dict
):
host
=
self
.
api_load
(
path_setting
.
HOSTYAML_CONFIG
)
url_host
=
""
if
host
[
"develop_host"
]
.
get
(
"doctor"
)
is
not
None
:
url_host
=
host
[
'develop_host'
][
'doctor'
]
elif
host
[
"develop_host"
]
.
get
(
"backend"
)
is
not
None
:
url_host
=
host
[
'develop_host'
][
'backend'
]
# 获取调用该方法的路径
import
inspect
ins_file
=
inspect
.
stack
()[
1
]
.
filename
ins_dir
=
ins_file
.
split
(
'/'
)[
-
2
]
host_service
=
ins_dir
.
split
(
'_'
)[
1
]
# default: backend
if
host_service
not
in
host
[
'develop_host'
]:
host_service
=
'backend'
url_host
=
host
[
'develop_host'
][
host_service
]
# if host["develop_host"].get("doctor") is not None:
# url_host = host['develop_host']['doctor']
# elif host["develop_host"].get("backend") is not None:
# url_host = host['develop_host']['backend']
raw
=
yaml
.
dump
(
req
)
# 将一个python对象生成为yaml文档
for
key
,
value
in
self
.
params
.
items
():
...
...
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