add a warn and don't apply ec2 unicast discovery if not found (will not really happen)

This commit is contained in:
kimchy 2010-12-30 13:18:00 +02:00
parent 789e1a343f
commit 976d14705a

View File

@ -49,10 +49,14 @@ public class Ec2Discovery extends ZenDiscovery {
break;
}
}
// update the unicast zen ping to add cloud hosts provider
// and, while we are at it, use only it and not the multicast for example
unicastZenPing.addHostsProvider(new AwsEc2UnicastHostsProvider(settings, ec2Service.client()));
pingService.zenPings(ImmutableList.of(unicastZenPing));
if (unicastZenPing != null) {
// update the unicast zen ping to add cloud hosts provider
// and, while we are at it, use only it and not the multicast for example
unicastZenPing.addHostsProvider(new AwsEc2UnicastHostsProvider(settings, ec2Service.client()));
pingService.zenPings(ImmutableList.of(unicastZenPing));
} else {
logger.warn("failed to apply ec2 unicast discovery, no unicast ping found");
}
}
}
}