mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-08 14:24:29 +02:00
Improve log message in ConfigObjectUtility::DeleteObjectHelper
refs #5094
This commit is contained in:
parent
f169232ef2
commit
2d6434e96a
@ -175,9 +175,12 @@ bool ConfigObjectUtility::DeleteObjectHelper(const ConfigObject::Ptr& object, bo
|
|||||||
{
|
{
|
||||||
std::vector<Object::Ptr> parents = DependencyGraph::GetParents(object);
|
std::vector<Object::Ptr> parents = DependencyGraph::GetParents(object);
|
||||||
|
|
||||||
|
Type::Ptr type = object->GetReflectionType();
|
||||||
|
|
||||||
if (!parents.empty() && !cascade) {
|
if (!parents.empty() && !cascade) {
|
||||||
if (errors)
|
if (errors)
|
||||||
errors->Add("Object cannot be deleted because other objects depend on it. "
|
errors->Add("Object '" + object->GetName() + "' of type '" + type->GetName() +
|
||||||
|
"' cannot be deleted because other objects depend on it. "
|
||||||
"Use cascading delete to delete it anyway.");
|
"Use cascading delete to delete it anyway.");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -192,8 +195,6 @@ bool ConfigObjectUtility::DeleteObjectHelper(const ConfigObject::Ptr& object, bo
|
|||||||
DeleteObjectHelper(parentObj, cascade, errors);
|
DeleteObjectHelper(parentObj, cascade, errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
Type::Ptr type = object->GetReflectionType();
|
|
||||||
|
|
||||||
ConfigItem::Ptr item = ConfigItem::GetByTypeAndName(type->GetName(), object->GetName());
|
ConfigItem::Ptr item = ConfigItem::GetByTypeAndName(type->GetName(), object->GetName());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user