Skip to content

Commit

Permalink
Merge pull request #938 from bensonhome/main
Browse files Browse the repository at this point in the history
🐛工具依赖 - 修复依赖方案条件为空时会误判为符合条件的情况
  • Loading branch information
cyw3 authored Oct 13, 2023
2 parents 0d47e40 + 3ead1e0 commit b792276
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions client/node/toolloader/loadconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,16 +387,12 @@ def __check_tool_scheme_condition(self, task_params, tool_scheme):
task_envs_str = task_params.get('envs', None)
task_envs = StringMgr.str_to_dict(task_envs_str) if task_envs_str else {}

if condition:
if task_envs:
if self.__envs_match_condition(task_envs, condition):
return True
else:
return False
else:
return False
else:
return True
# 当条件和环境变量都存在时,才判断是否符合当前方案条件
# 条件和环境变量任一不存在,都判定为不符合
if condition and task_envs:
if self.__envs_match_condition(task_envs, condition):
return True
return False

def __envs_match_condition(self, task_envs, condition):
"""
Expand Down

0 comments on commit b792276

Please sign in to comment.