From debc4a12e3aec31951a1759ce26525817d953bae Mon Sep 17 00:00:00 2001 From: WeibiaoYu Date: Sat, 20 Jun 2020 05:35:11 -0400 Subject: [PATCH] fix the ci problem of function length --- mindinsight/profiler/profiling.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/mindinsight/profiler/profiling.py b/mindinsight/profiler/profiling.py index 542b3de..5a28eba 100644 --- a/mindinsight/profiler/profiling.py +++ b/mindinsight/profiler/profiling.py @@ -136,10 +136,6 @@ class Profiler: logger.error("Profiling: fail to import release from mindspore.") job_id = self._get_profiling_job_id() - if not job_id: - msg = ("Fail to get profiling job, please check whether job dir was generated") - raise RuntimeError(msg) - logger.info("Profiling: job id is %s ", job_id) source_path = os.path.join(PROFILING_LOG_BASE_PATH, job_id) @@ -180,9 +176,7 @@ class Profiler: # parse minddata pipeline operator and queue try: - pipeline_parser = MinddataPipelineParser( - self._output_path, self._dev_id, self._output_path - ) + pipeline_parser = MinddataPipelineParser(self._output_path, self._dev_id, self._output_path) pipeline_parser.parse() except MindInsightException as err: logger.warning(err.message) @@ -314,6 +308,10 @@ class Profiler: job_id = item.strip() break + if not job_id: + msg = ("Fail to get profiling job, please check whether job dir was generated") + raise RuntimeError(msg) + return job_id def _parse_host_start_log(self, input_file): -- GitLab