From 030030deb2ba99b93bc321adc4a6256c528584b8 Mon Sep 17 00:00:00 2001 From: ms_yan Date: Mon, 21 Jun 2021 21:03:32 +0800 Subject: [PATCH] delete GetEnvConfigFile func as it no longer used --- mindspore/ccsrc/debug/common.cc | 25 ------------------------- mindspore/ccsrc/debug/common.h | 1 - 2 files changed, 26 deletions(-) diff --git a/mindspore/ccsrc/debug/common.cc b/mindspore/ccsrc/debug/common.cc index 7d9a82912c7..5927f5a7c17 100644 --- a/mindspore/ccsrc/debug/common.cc +++ b/mindspore/ccsrc/debug/common.cc @@ -20,7 +20,6 @@ #include #include #include -#include "utils/ms_context.h" #include "utils/system/env.h" #include "utils/system/file_system.h" #include "utils/log_adapter.h" @@ -146,30 +145,6 @@ std::optional Common::GetConfigFile(const std::string &env) { return dump_config_file; } -std::optional Common::GetEnvConfigFile() { - auto context = MsContext::GetInstance(); - MS_EXCEPTION_IF_NULL(context); - std::string env_config_path = context->get_param(MS_CTX_ENV_CONFIG_PATH); - if (env_config_path.empty()) { - MS_LOG(INFO) << "The env_config_path is not set in context."; - return {}; - } - MS_LOG(INFO) << "Get env_config_path: " << env_config_path; - - std::string config_file(env_config_path); - std::shared_ptr fs = system::Env::GetFileSystem(); - MS_EXCEPTION_IF_NULL(fs); - if (!fs->FileExist(config_file)) { - MS_LOG(ERROR) << config_file << " not exist."; - return {}; - } - auto point_pos = config_file.find_last_of('.'); - if (point_pos == std::string::npos) { - MS_LOG(EXCEPTION) << "Invalid json file name:" << config_file; - } - return config_file; -} - bool Common::IsStrLengthValid(const std::string &str, size_t length_limit, const std::string &error_message) { auto len_str = str.length(); if (len_str > length_limit) { diff --git a/mindspore/ccsrc/debug/common.h b/mindspore/ccsrc/debug/common.h index dd8f1d5c8c4..eff9c2efe62 100644 --- a/mindspore/ccsrc/debug/common.h +++ b/mindspore/ccsrc/debug/common.h @@ -31,7 +31,6 @@ class Common { ~Common() = default; static std::optional GetRealPath(const std::string &input_path); static std::optional GetConfigFile(const std::string &env); - static std::optional GetEnvConfigFile(); static bool IsStrLengthValid(const std::string &str, size_t length_limit, const std::string &error_message = ""); static bool IsPathValid(const std::string &path, size_t length_limit, const std::string &error_message = ""); static bool IsFilenameValid(const std::string &filename, size_t length_limit, const std::string &error_message = "");