Cli: Don't add empty host/port endpoint attributes in node wizard

refs #9205
refs #9536
This commit is contained in:
Michael Friedrich 2015-07-03 12:58:54 +02:00
parent ed3882ba33
commit f4aeb1999c
1 changed files with 6 additions and 2 deletions

View 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];