From e1bb085b0f16140f196e58ff941d88f8491375ff Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Thu, 5 Jan 2023 18:05:31 +0100 Subject: [PATCH] ConfigObjectUtility::DeleteObjectHelper(): only delete _api files to restore the behavior before the previous commit. Otherwise we'd delete all API object's child objects' files including applied child object rules in /etc. --- lib/remote/configobjectutility.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/remote/configobjectutility.cpp b/lib/remote/configobjectutility.cpp index bc24b9b49..db30f283a 100644 --- a/lib/remote/configobjectutility.cpp +++ b/lib/remote/configobjectutility.cpp @@ -353,7 +353,9 @@ bool ConfigObjectUtility::DeleteObjectHelper(const ConfigObject::Ptr& object, bo return false; } - Utility::Remove(GetExistingObjectConfigPath(object)); + if (object->GetPackage() == "_api") { + Utility::Remove(GetExistingObjectConfigPath(object)); + } Log(LogInformation, "ConfigObjectUtility") << "Deleted object '" << name << "' of type '" << type->GetName() << "'.";