From 1bec9692c688f43c043e15f299ad3d3aa16f750d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 17 Dec 2013 09:50:19 +0100 Subject: [PATCH] Fix address and address6 being empty in objects.cache fixes #5352 --- lib/icinga/compatutility.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/icinga/compatutility.cpp b/lib/icinga/compatutility.cpp index f1bbb9f4c..1a394867a 100644 --- a/lib/icinga/compatutility.cpp +++ b/lib/icinga/compatutility.cpp @@ -77,9 +77,11 @@ String CompatUtility::GetHostAddress(const Host::Ptr& host) String address; - if (macros) { + if (macros) address = macros->Get("address"); - } + + if (address.IsEmpty()) + address = host->GetName(); return address; } @@ -92,9 +94,11 @@ String CompatUtility::GetHostAddress6(const Host::Ptr& host) String address6; - if (macros) { + if (macros) address6 = macros->Get("address6"); - } + + if (address6.IsEmpty()) + address6 = host->GetName(); return address6; } -- 2.40.0