diff --git a/src/config_export_module/config_export.cpp b/src/config_export_module/config_export.cpp index 8e2e449564..4420133543 100644 --- a/src/config_export_module/config_export.cpp +++ b/src/config_export_module/config_export.cpp @@ -143,8 +143,8 @@ Status updateConfigAddModel(const std::string& fullPath, const ModelsSettingsImp } if (alreadyAdded) { - SPDLOG_ERROR("Could not add model to configuration file: {}. Model with the same name already exists.", modelSettings.modelName); - return StatusCode::MODEL_NAME_OCCUPIED; + SPDLOG_INFO("Model with this name already exists.", modelSettings.modelName); + return StatusCode::OK; } auto alloc = configJson.GetAllocator(); diff --git a/src/status.cpp b/src/status.cpp index 3e3b9425b9..d8727538b1 100644 --- a/src/status.cpp +++ b/src/status.cpp @@ -28,7 +28,7 @@ const std::unordered_map Status::statusMessageMap = { {StatusCode::FILESYSTEM_ERROR, "Error during filesystem operation"}, {StatusCode::NOT_IMPLEMENTED, "Functionality not implemented"}, {StatusCode::NO_MODEL_VERSION_AVAILABLE, "Not a single model version directory has valid numeric name"}, - {StatusCode::MODEL_NOT_LOADED, "Error while loading a model"}, + {StatusCode::MODEL_NOT_LOADED, "Model not loaded"}, {StatusCode::JSON_INVALID, "The file is not valid json"}, {StatusCode::JSON_SERIALIZATION_ERROR, "Data serialization to json format failed"}, {StatusCode::MODELINSTANCE_NOT_FOUND, "ModelInstance not found"}, diff --git a/src/test/config_export_test.cpp b/src/test/config_export_test.cpp index 87382c509f..dbcde69c33 100644 --- a/src/test/config_export_test.cpp +++ b/src/test/config_export_test.cpp @@ -388,7 +388,7 @@ TEST_F(ConfigCreationTest, negativeInternalErrorForType) { ASSERT_EQ(status, ovms::StatusCode::NOT_IMPLEMENTED); } -TEST_F(ConfigCreationTest, negativeAddTheSameModelName) { +TEST_F(ConfigCreationTest, AddTheSameModelName) { auto status = ovms::updateConfig(this->modelsSettings, ovms::ENABLE_MODEL); ASSERT_EQ(status, ovms::StatusCode::OK); @@ -397,7 +397,7 @@ TEST_F(ConfigCreationTest, negativeAddTheSameModelName) { // Add second model status = ovms::updateConfig(this->modelsSettings, ovms::ENABLE_MODEL); - ASSERT_EQ(status, ovms::StatusCode::MODEL_NAME_OCCUPIED); + ASSERT_EQ(status, ovms::StatusCode::OK); } TEST_F(ConfigCreationTest, negativeRemoveNotExistingName) {