mirror of https://github.com/apache/jclouds.git
Issue 27: timeout adjustments and fixed a subtle bug in listnodes
This commit is contained in:
parent
3cd0c2223d
commit
4b91eb6046
|
@ -20,6 +20,7 @@ package org.jclouds.aws.ec2;
|
|||
|
||||
import static org.jclouds.aws.ec2.reference.EC2Constants.PROPERTY_EC2_AMI_OWNERS;
|
||||
import static org.jclouds.aws.ec2.reference.EC2Constants.PROPERTY_EC2_ENDPOINT;
|
||||
import static org.jclouds.compute.reference.ComputeServiceConstants.PROPERTY_TIMEOUT_PORT_OPEN;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
|
@ -38,6 +39,8 @@ public class EucalyptusPropertiesBuilder extends EC2PropertiesBuilder {
|
|||
// properties.setProperty(PROPERTY_ELB_ENDPOINT,
|
||||
// "https://elasticloadbalancing.us-east-1.amazonaws.com");
|
||||
properties.setProperty(PROPERTY_EC2_AMI_OWNERS, "admin");
|
||||
properties.setProperty(PROPERTY_TIMEOUT_PORT_OPEN, 5 * 60 * 1000 + "");
|
||||
|
||||
return properties;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ import static org.jclouds.concurrent.ConcurrentUtils.awaitCompletion;
|
|||
import java.net.URI;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
@ -262,10 +263,14 @@ public class EC2ComputeServiceContextModule extends EC2ContextModule {
|
|||
String[] parts = parseHandle(id);
|
||||
String region = parts[0];
|
||||
String instanceId = parts[1];
|
||||
RunningInstance runningInstance = Iterables
|
||||
.getOnlyElement(getAllRunningInstancesInRegion(client
|
||||
.getInstanceServices(), region, instanceId));
|
||||
return runningInstanceToNodeMetadata.apply(runningInstance);
|
||||
try {
|
||||
RunningInstance runningInstance = Iterables
|
||||
.getOnlyElement(getAllRunningInstancesInRegion(client
|
||||
.getInstanceServices(), region, instanceId));
|
||||
return runningInstanceToNodeMetadata.apply(runningInstance);
|
||||
} catch (NoSuchElementException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue