Skip to content

Commit

Permalink
bugfix: Windows卸载命令拼接错误 (closed #1078)
Browse files Browse the repository at this point in the history
  • Loading branch information
CohleRustW authored and ZhuoZhuoCrayon committed Sep 22, 2022
1 parent 0e34f2a commit 604bf5d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apps/backend/agent/solution_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ def get_run_cmd_base_params(self) -> typing.List[str]:
f"-p {self.agent_config['setup_path']}",
f"-c {self.token}",
f"-s {self.pipeline_id}",
"-R" if self.is_uninstall else "",
]

# 系统开启使用密码注册 Windows 服务时,需额外传入 -U -P 参数,用于注册 Windows 服务,详见 setup_agent.bat 脚本
Expand All @@ -236,6 +235,10 @@ def get_run_cmd_base_params(self) -> typing.List[str]:
else:
run_cmd_params.extend(["-N SERVER"])

# 因bat脚本逻辑,-R 参数只能放在最后一位
if self.is_uninstall:
run_cmd_params.extend(["-R"])

return list(filter(None, run_cmd_params))

def add_sudo_to_cmds(self, execution_solution: ExecutionSolution):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,6 @@ def test_shell_solution(self):
f" -l http://127.0.0.1/download -r http://127.0.0.1/backend"
f" -i 0 -I {host.inner_ip} -T {installation_tool.dest_dir} -p /usr/local/gse"
f" -c {solution_parse_result['params']['token']} -s {mock_data_utils.JOB_TASK_PIPELINE_ID}"
f" -R -N SERVER &> /tmp/nm.nohup.out &",
f" -N SERVER -R &> /tmp/nm.nohup.out &",
],
)
3 changes: 3 additions & 0 deletions dev_log/2.2.23/xcwang_202209161638.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfix:
- "Windows卸载命令拼接错误 (closed #1078)"

0 comments on commit 604bf5d

Please sign in to comment.