mirror of https://github.com/Icinga/icinga2.git
Icinga DB: dump the correct icinga:config:endpoint#zone_id
This commit is contained in:
parent
9830dc194b
commit
7dcf48f707
|
@ -1089,14 +1089,20 @@ bool IcingaDB::PrepareObject(const ConfigObject::Ptr& object, Dictionary::Ptr& a
|
||||||
attributes->Set("environment_id", SHA1(GetEnvironment()));
|
attributes->Set("environment_id", SHA1(GetEnvironment()));
|
||||||
attributes->Set("name", object->GetName());
|
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) {
|
if (ObjectsZone) {
|
||||||
attributes->Set("zone_id", GetObjectIdentifier(ObjectsZone));
|
attributes->Set("zone_id", GetObjectIdentifier(ObjectsZone));
|
||||||
attributes->Set("zone", ObjectsZone->GetName());
|
attributes->Set("zone", ObjectsZone->GetName());
|
||||||
}
|
}
|
||||||
|
|
||||||
Type::Ptr type = object->GetReflectionType();
|
|
||||||
|
|
||||||
if (type == Endpoint::TypeInstance) {
|
if (type == Endpoint::TypeInstance) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue