diff --git a/compute/src/main/java/org/jclouds/compute/domain/NodeState.java b/compute/src/main/java/org/jclouds/compute/domain/NodeState.java index 7d832aa200..2caef05901 100644 --- a/compute/src/main/java/org/jclouds/compute/domain/NodeState.java +++ b/compute/src/main/java/org/jclouds/compute/domain/NodeState.java @@ -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, /** diff --git a/compute/src/main/java/org/jclouds/compute/domain/internal/ImageImpl.java b/compute/src/main/java/org/jclouds/compute/domain/internal/ImageImpl.java index d9f0c3310c..08e4d96da9 100644 --- a/compute/src/main/java/org/jclouds/compute/domain/internal/ImageImpl.java +++ b/compute/src/main/java/org/jclouds/compute/domain/internal/ImageImpl.java @@ -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 diff --git a/compute/src/main/java/org/jclouds/compute/internal/TemplateBuilderImpl.java b/compute/src/main/java/org/jclouds/compute/internal/TemplateBuilderImpl.java index c5f813cc77..32a7116cf0 100644 --- a/compute/src/main/java/org/jclouds/compute/internal/TemplateBuilderImpl.java +++ b/compute/src/main/java/org/jclouds/compute/internal/TemplateBuilderImpl.java @@ -476,7 +476,7 @@ public class TemplateBuilderImpl implements TemplateBuilder { logger.trace("<< matched images(%s)", matchingImages); List 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); diff --git a/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java b/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java index c88ef0066b..9dd637a9b9 100755 --- a/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java +++ b/compute/src/test/java/org/jclouds/compute/BaseComputeServiceLiveTest.java @@ -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 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; diff --git a/vcloud/core/src/main/java/org/jclouds/vcloud/compute/config/VCloudComputeServiceContextModule.java b/vcloud/core/src/main/java/org/jclouds/vcloud/compute/config/VCloudComputeServiceContextModule.java index c628f3e678..2e18112daa 100755 --- a/vcloud/core/src/main/java/org/jclouds/vcloud/compute/config/VCloudComputeServiceContextModule.java +++ b/vcloud/core/src/main/java/org/jclouds/vcloud/compute/config/VCloudComputeServiceContextModule.java @@ -85,11 +85,12 @@ public class VCloudComputeServiceContextModule extends VCloudContextModule { this.providerName = providerName; } + @Singleton @Provides Map provideVAppStatusToNodeState() { return ImmutableMap. 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(); } diff --git a/vcloud/core/src/main/java/org/jclouds/vcloud/config/VCloudRestClientModule.java b/vcloud/core/src/main/java/org/jclouds/vcloud/config/VCloudRestClientModule.java index e230ad600a..7f71d1e6ca 100644 --- a/vcloud/core/src/main/java/org/jclouds/vcloud/config/VCloudRestClientModule.java +++ b/vcloud/core/src/main/java/org/jclouds/vcloud/config/VCloudRestClientModule.java @@ -113,7 +113,7 @@ public class VCloudRestClientModule extends AbstractModule { @Provides @Singleton protected Predicate successTester(TaskSuccess success) { - return new RetryablePredicate(success, 600, 10, TimeUnit.SECONDS); + return new RetryablePredicate(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);