From f4aeb1999c171688dfb73dced3a9ffe08e6f4185 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Fri, 3 Jul 2015 12:58:54 +0200 Subject: [PATCH] Cli: Don't add empty host/port endpoint attributes in node wizard refs #9205 refs #9536 --- lib/cli/nodeutility.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/cli/nodeutility.cpp b/lib/cli/nodeutility.cpp index 8b2745205..0a95de509 100644 --- a/lib/cli/nodeutility.cpp +++ b/lib/cli/nodeutility.cpp @@ -273,13 +273,17 @@ int NodeUtility::GenerateNodeIcingaConfig(const std::vector& endpoi if (tokens.size() > 1) { String host = tokens[1]; host.Trim(); - my_master_endpoint->Set("host", host); + + if (!host.IsEmpty()) + my_master_endpoint->Set("host", host); } if (tokens.size() > 2) { String port = tokens[2]; port.Trim(); - my_master_endpoint->Set("port", port); + + if (!port.IsEmpty()) + my_master_endpoint->Set("port", port); } String cn = tokens[0]; -- 2.50.1