Skip to content

Commit

Permalink
bugfix: P-Agent无法连接外网时,安装失败的问题 (fixed #354)
Browse files Browse the repository at this point in the history
  • Loading branch information
CohleRustW authored and zhangzhw8 committed Dec 17, 2021
1 parent 6ba94fa commit f12e33d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/backend/agent/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ def gen_commands(host: models.Host, pipeline_id: str, is_uninstall: bool) -> Ins
if host.install_channel_id:
__, upstream_servers = host.install_channel()
agent_download_proxy = upstream_servers.get("agent_download_proxy", True)
if agent_download_proxy:
# 打开agent下载代理选项时传入
if not agent_download_proxy:
# 关闭agent下载代理选项时传入
run_cmd_params.extend([f"-ADP '{agent_download_proxy}'"])
channel_proxy_address = upstream_servers.get("channel_proxy_address", None)
if channel_proxy_address:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ def setUp(self):
"btfileserver": ["127.0.0.1"],
"dataserver": ["127.0.0.1"],
"channel_proxy_address": "http://127.0.0.1:17981",
"agent_download_proxy": True,
"agent_download_proxy": False,
},
)
models.Host.objects.filter(bk_host_id=utils.BK_HOST_ID).update(install_channel_id=install_channel.id)
Expand Down Expand Up @@ -552,7 +552,7 @@ def test_gen_install_channel_agent_command(self):
f" -HPP '17981' -HSN 'setup_agent.sh' -HS 'bash'"
f" -p '/usr/local/gse' -I 1.1.1.1"
f" -o http://1.1.1.1:{settings.BK_NODEMAN_NGINX_DOWNLOAD_PORT}/"
f" -ADP 'True' -CPA 'http://127.0.0.1:17981'"
f" -ADP 'False' -CPA 'http://127.0.0.1:17981'"
)
self.assertEqual(installation_tool.run_cmd, run_cmd)

Expand Down
3 changes: 3 additions & 0 deletions dev_log/2.1.361/xcwang_202112162039.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfix:
- "P-Agent无法连接外网时,安装失败的问题 (fixed #354)"

0 comments on commit f12e33d

Please sign in to comment.