mirror of https://github.com/Icinga/icinga2.git
Cli: Don't add empty host/port endpoint attributes in node wizard
refs #9205 refs #9536
This commit is contained in:
parent
ed3882ba33
commit
f4aeb1999c
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue