]> granicus.if.org Git - icinga2/commitdiff
Cli: Don't add empty host/port endpoint attributes in node wizard
authorMichael Friedrich <michael.friedrich@netways.de>
Fri, 3 Jul 2015 10:58:54 +0000 (12:58 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Fri, 3 Jul 2015 10:58:54 +0000 (12:58 +0200)
refs #9205
refs #9536

lib/cli/nodeutility.cpp

index 8b27452058abdf126143fdb22b07a14dcd5fb5b4..0a95de5097a46c1c1e75f1784056f6e863642ff9 100644 (file)
@@ -273,13 +273,17 @@ int NodeUtility::GenerateNodeIcingaConfig(const std::vector<std::string>& 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];