Unicast Discovery: When providing a comma separated list of addresses, trim them from whitespaces, closes #1193.
This commit is contained in:
parent
a0bbb5445a
commit
885c80f8e5
|
@ -235,7 +235,10 @@ public class ImmutableSettings implements Settings {
|
|||
List<String> result = Lists.newArrayList();
|
||||
|
||||
if (get(settingPrefix) != null) {
|
||||
Collections.addAll(result, Strings.commaDelimitedListToStringArray(get(settingPrefix)));
|
||||
String[] strings = Strings.splitStringByCommaToArray(get(settingPrefix));
|
||||
if (strings.length > 0) {
|
||||
Collections.addAll(result, strings);
|
||||
}
|
||||
}
|
||||
|
||||
int counter = 0;
|
||||
|
|
|
@ -100,7 +100,12 @@ public class UnicastZenPing extends AbstractLifecycleComponent<ZenPing> implemen
|
|||
this.transportService = transportService;
|
||||
this.clusterName = clusterName;
|
||||
|
||||
List<String> hosts = Lists.newArrayList(componentSettings.getAsArray("hosts"));
|
||||
String[] hostArr = componentSettings.getAsArray("hosts");
|
||||
// trim the hosts
|
||||
for (int i = 0; i < hostArr.length; i++) {
|
||||
hostArr[i] = hostArr[i].trim();
|
||||
}
|
||||
List<String> hosts = Lists.newArrayList(hostArr);
|
||||
logger.debug("using initial hosts {}", hosts);
|
||||
|
||||
List<DiscoveryNode> nodes = Lists.newArrayList();
|
||||
|
|
Loading…
Reference in New Issue