From 43bcff262efe83fc081ae9cdc1e164fe10aa30b3 Mon Sep 17 00:00:00 2001 From: shupiaoyang Date: Tue, 11 Mar 2025 10:17:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D`main=5Freader.py`=E4=B8=AD`g?= =?UTF-8?q?et=5Faction`=E6=96=B9=E6=B3=95=E7=9A=84=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=8C=E5=B9=B6=E5=9C=A8`run=5Fcmd.py`?= =?UTF-8?q?=E4=B8=AD=E6=B7=BB=E5=8A=A0=E5=AF=B9`tasks`=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E7=9A=84=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oedp/src/commands/run/run_cmd.py | 3 +++ oedp/src/utils/main_reader.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/oedp/src/commands/run/run_cmd.py b/oedp/src/commands/run/run_cmd.py index 9e92a92..be38854 100644 --- a/oedp/src/commands/run/run_cmd.py +++ b/oedp/src/commands/run/run_cmd.py @@ -42,5 +42,8 @@ class RunCmd: except ConfigException as e: self.log.error(f'Failed to get project main info: {e}') return False + if 'tasks' not in action: + self.log.error(f'Failed to get tasks info: {action}') + return False tasks = action['tasks'] return RunAction(self.project, self.action, tasks).run() diff --git a/oedp/src/utils/main_reader.py b/oedp/src/utils/main_reader.py index 0b0c2e0..17d0a3c 100644 --- a/oedp/src/utils/main_reader.py +++ b/oedp/src/utils/main_reader.py @@ -108,11 +108,11 @@ class MainReader: :return: 方法详情 """ if 'action' not in self.main: - return {} + raise ConfigException(f'No such action named {action}') if not isinstance(self.main['action'], dict): - return {} + raise ConfigException(f'No such action named {action}') if action not in self.main['action']: - return {} + raise ConfigException(f'No such action named {action}') if not isinstance(self.main['action'][action], dict): return {} return self.main['action'][action] -- Gitee