Fix checkstyle and a test

This commit is contained in:
David Pilato 2017-01-26 17:20:27 +01:00
parent 17930930a7
commit d97750b52c
2 changed files with 5 additions and 3 deletions

View File

@ -174,6 +174,8 @@ public class AwsEc2UnicastHostsProvider extends AbstractComponent implements Uni
logger.debug("using [{}] as the instance address", address);
}
}
} else {
throw new IllegalArgumentException(hostType + " is unknown for discovery.ec2.host_type");
}
if (address != null) {
try {
@ -181,8 +183,8 @@ public class AwsEc2UnicastHostsProvider extends AbstractComponent implements Uni
TransportAddress[] addresses = transportService.addressesFromString(address, 1);
for (int i = 0; i < addresses.length; i++) {
logger.trace("adding {}, address {}, transport_address {}", instance.getInstanceId(), address, addresses[i]);
discoNodes.add(new DiscoveryNode(instance.getInstanceId(), "#cloud-" + instance.getInstanceId() + "-" + i, addresses[i],
emptyMap(), emptySet(), Version.CURRENT.minimumCompatibilityVersion()));
discoNodes.add(new DiscoveryNode(instance.getInstanceId(), "#cloud-" + instance.getInstanceId() + "-" + i,
addresses[i], emptyMap(), emptySet(), Version.CURRENT.minimumCompatibilityVersion()));
}
} catch (Exception e) {
final String finalAddress = address;

View File

@ -201,7 +201,7 @@ public class Ec2DiscoveryTests extends ESTestCase {
buildDynamicNodes(nodeSettings, 1);
fail("Expected IllegalArgumentException");
} catch (IllegalArgumentException e) {
assertThat(e.getMessage(), containsString("No enum constant"));
assertThat(e.getMessage(), containsString("does_not_exist is unknown for discovery.ec2.host_type"));
}
}