mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-21 20:54:35 +02:00
Fix problem with missing config items
This commit is contained in:
parent
8bd091fef0
commit
25ee5dd1fd
@ -231,11 +231,20 @@ void ConfigItem::Register(void)
|
|||||||
{
|
{
|
||||||
String name = m_Name;
|
String name = m_Name;
|
||||||
|
|
||||||
|
/* If this is a non-abstract object we need to figure out
|
||||||
|
* its real name now - or assign it a temporary name. */
|
||||||
|
if (!m_Abstract) {
|
||||||
shared_ptr<NameComposer> nc = dynamic_pointer_cast<NameComposer>(Type::GetByName(m_Type));
|
shared_ptr<NameComposer> nc = dynamic_pointer_cast<NameComposer>(Type::GetByName(m_Type));
|
||||||
|
|
||||||
/* If this is a non-abstract object with a composite name we don't register it. */
|
if (nc) {
|
||||||
if (!m_Abstract && nc)
|
name = nc->MakeName(m_Name, Dictionary::Ptr());
|
||||||
return;
|
|
||||||
|
ASSERT(name.IsEmpty() || name == m_Name);
|
||||||
|
|
||||||
|
if (name.IsEmpty())
|
||||||
|
name = Utility::NewUniqueID();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::pair<String, String> key = std::make_pair(m_Type, name);
|
std::pair<String, String> key = std::make_pair(m_Type, name);
|
||||||
ConfigItem::Ptr self = GetSelf();
|
ConfigItem::Ptr self = GetSelf();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user