> @@ -175,8 +179,14 @@ public String toString() {
> };
> }
>
> - private static FluentIterable<String> checkNodeHasIps(NodeMetadata node) {
> - FluentIterable<String> ips =
> FluentIterable.from(concat(node.getPublicAddresses(),
> node.getPrivateAddresses()));
> + private static FluentIterable<String> checkNodeHasIps(NodeMetadata node,
> boolean excludePublic) {
> + FluentIterable<String> ips;
> + if(excludePublic){
> + ips = FluentIterable.from(node.getPrivateAddresses());
> + }else{
> + ips = FluentIterable.from(concat(node.getPublicAddresses(),
> node.getPrivateAddresses()));
> + }
Formatting. How about
```
Iterable<String> ips = node.getPrivateAddresses();
if (!excludePublicIps) {
ips = concat(ips, node.getPublicAddresses());
}
checkState(size(ips) > 0, "node does not have IP addresses configured: " +
node);
return FluentIterable.from(ips);
```
which removes the `else`?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/341/files#r11421293