fixed a minor vcloud bug and toString statements

This commit is contained in:
Adrian Cole 2010-05-23 00:26:50 -07:00
parent dbd42ce7ac
commit 5b300f87cc
6 changed files with 17 additions and 9 deletions

View File

@ -29,11 +29,11 @@ public enum NodeState {
*/
PENDING,
/**
* The node is not running
* The node is visible, and in the process of being deleted.
*/
TERMINATED,
/**
* The node is deployed, but suspended
* The node is deployed, but suspended or stopped.
*/
SUSPENDED,
/**

View File

@ -118,7 +118,7 @@ public class ImageImpl extends ComputeMetadataImpl implements Image {
return "[id=" + getId() + ", providerId=" + getProviderId() + ", name=" + getName()
+ ", locationId=" + (getLocation() != null ? getLocation().getId() : "null")
+ ", architecture=" + architecture + ", osDescription=" + osDescription
+ ", version=" + version + ", osFamily=" + osFamily + ", version=" + version + "]";
+ ", version=" + version + ", osFamily=" + osFamily + "]";
}
@Override

View File

@ -476,7 +476,7 @@ public class TemplateBuilderImpl implements TemplateBuilder {
logger.trace("<< matched images(%s)", matchingImages);
List<? extends Image> maxImages = Utils.multiMax(DEFAULT_IMAGE_ORDERING, matchingImages);
if (logger.isTraceEnabled())
logger.debug("<< best images(%s)", maxImages);
logger.trace("<< best images(%s)", maxImages);
return maxImages;
} catch (NoSuchElementException exception) {
throw new NoSuchElementException("image didn't match: " + toString() + "\n" + images);

View File

@ -229,6 +229,12 @@ public abstract class BaseComputeServiceLiveTest {
@Test(enabled = true, dependsOnMethods = "testCorrectAuthException")
public void testScriptExecutionAfterBootWithBasicTemplate() throws Exception {
String tag = this.tag + "run";
try {
client.destroyNodesMatching(NodePredicates.withTag(tag));
} catch (Exception e) {
}
TemplateOptions options = client.templateOptions().blockOnPort(22, 120);
try {
Set<? extends NodeMetadata> nodes = client.runNodesWithTag(tag, 1, options);
@ -374,7 +380,7 @@ public abstract class BaseComputeServiceLiveTest {
// assert nodeMetadata.getImage() != null : node;
// user specified name is not always supported
// assert nodeMetadata.getName() != null : nodeMetadata;
if (nodeMetadata.getState() != NodeState.TERMINATED) {
if (nodeMetadata.getState() == NodeState.RUNNING) {
assert nodeMetadata.getPublicAddresses() != null : nodeMetadata;
assert nodeMetadata.getPublicAddresses().size() > 0
|| nodeMetadata.getPrivateAddresses().size() > 0 : nodeMetadata;

View File

@ -85,11 +85,12 @@ public class VCloudComputeServiceContextModule extends VCloudContextModule {
this.providerName = providerName;
}
@Singleton
@Provides
Map<VAppStatus, NodeState> provideVAppStatusToNodeState() {
return ImmutableMap.<VAppStatus, NodeState> builder().put(VAppStatus.OFF,
NodeState.TERMINATED).put(VAppStatus.ON, NodeState.RUNNING).put(VAppStatus.RESOLVED,
NodeState.SUSPENDED).put(VAppStatus.ON, NodeState.RUNNING).put(VAppStatus.RESOLVED,
NodeState.PENDING).put(VAppStatus.SUSPENDED, NodeState.SUSPENDED).put(
VAppStatus.UNRESOLVED, NodeState.PENDING).build();
}

View File

@ -113,7 +113,7 @@ public class VCloudRestClientModule extends AbstractModule {
@Provides
@Singleton
protected Predicate<String> successTester(TaskSuccess success) {
return new RetryablePredicate<String>(success, 600, 10, TimeUnit.SECONDS);
return new RetryablePredicate<String>(success, 60 * 30, 10, TimeUnit.SECONDS);
}
@Provides
@ -163,8 +163,9 @@ public class VCloudRestClientModule extends AbstractModule {
try {
return login.login().get(180, TimeUnit.SECONDS);
} catch (Exception e) {
Throwables.propagateIfPossible(e);
throw new RuntimeException("Error logging in", e);
Throwables.propagate(e);
assert false;
return null;
}
}
}, seconds, TimeUnit.SECONDS);