Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/config_export_module/config_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const std::unordered_map<StatusCode, std::string> 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"},
Expand Down
4 changes: 2 additions & 2 deletions src/test/config_export_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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) {
Expand Down