mirror of https://github.com/Icinga/icinga2.git
Merge pull request #8706 from Icinga/bugfix/icingadb-endpoint-zone
Icinga DB: dump the correct icinga:config:endpoint#zone_id
This commit is contained in:
commit
7f5225ecaa
|
@ -1088,14 +1088,20 @@ bool IcingaDB::PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& a
|
|||
attributes->Set("environment_id", m_EnvironmentId);
|
||||
attributes->Set("name", object->GetName());
|
||||
|
||||
Zone::Ptr ObjectsZone = static_pointer_cast<Zone>(object->GetZone());
|
||||
Zone::Ptr ObjectsZone;
|
||||
Type::Ptr type = object->GetReflectionType();
|
||||
|
||||
if (type == Endpoint::TypeInstance) {
|
||||
ObjectsZone = static_cast<Endpoint*>(object.get())->GetZone();
|
||||
} else {
|
||||
ObjectsZone = static_pointer_cast<Zone>(object->GetZone());
|
||||
}
|
||||
|
||||
if (ObjectsZone) {
|
||||
attributes->Set("zone_id", GetObjectIdentifier(ObjectsZone));
|
||||
attributes->Set("zone", ObjectsZone->GetName());
|
||||
}
|
||||
|
||||
Type::Ptr type = object->GetReflectionType();
|
||||
|
||||
if (type == Endpoint::TypeInstance) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue