Updated Comment.

This commit is contained in:
vijaykiran 2012-07-10 01:34:46 +02:00
parent 9cceb4e05f
commit 66dbff6b45
1 changed files with 3 additions and 1 deletions

View File

@ -50,6 +50,7 @@ import org.jclouds.ec2.domain.InstanceState;
import org.jclouds.ec2.domain.RootDeviceType;
import org.jclouds.ec2.domain.RunningInstance;
import org.jclouds.logging.Logger;
import org.jclouds.util.InetAddresses2;
import org.jclouds.util.InetAddresses2.IsPrivateIPAddress;
import com.google.common.annotations.VisibleForTesting;
@ -122,7 +123,8 @@ public class RunningInstanceToNodeMetadata implements Function<RunningInstance,
Builder<String> addressesBuilder = ImmutableSet.builder();
if (Strings.emptyToNull(instance.getIpAddress()) != null)
addressesBuilder.add(instance.getIpAddress());
//Set ipAddress to be
//Add dnsName (if available) to addresses, when the IPAddress is null
// happens on Eucalyptus sometimes.
else if(Strings.emptyToNull(instance.getDnsName()) != null)
addressesBuilder.add(instance.getDnsName());
if (Strings.emptyToNull(instance.getPrivateIpAddress()) != null)