mirror of https://github.com/Icinga/icinga2.git
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);
|
||||
|
||||
Type::Ptr type = object->GetReflectionType();
|
||||
|
||||
if (!parents.empty() && !cascade) {
|
||||
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.");
|
||||
|
||||
return false;
|
||||
|
@ -192,8 +195,6 @@ bool ConfigObjectUtility::DeleteObjectHelper(const ConfigObject::Ptr& object, bo
|
|||
DeleteObjectHelper(parentObj, cascade, errors);
|
||||
}
|
||||
|
||||
Type::Ptr type = object->GetReflectionType();
|
||||
|
||||
ConfigItem::Ptr item = ConfigItem::GetByTypeAndName(type->GetName(), object->GetName());
|
||||
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue