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 1d0107cc65..f57be120a2 100644 --- a/compute/src/main/java/org/jclouds/compute/internal/TemplateBuilderImpl.java +++ b/compute/src/main/java/org/jclouds/compute/internal/TemplateBuilderImpl.java @@ -1,3 +1,21 @@ +/** + * + * Copyright (C) 2009 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ==================================================================== + */ package org.jclouds.compute.internal; import static com.google.common.base.Preconditions.checkArgument; diff --git a/vcloud/bluelock/src/test/java/org/jclouds/vcloud/bluelock/compute/BlueLockVCloudComputeServiceLiveTest.java b/vcloud/bluelock/src/test/java/org/jclouds/vcloud/bluelock/compute/BlueLockVCloudComputeServiceLiveTest.java index 83bcf9a97a..29d86e55a9 100644 --- a/vcloud/bluelock/src/test/java/org/jclouds/vcloud/bluelock/compute/BlueLockVCloudComputeServiceLiveTest.java +++ b/vcloud/bluelock/src/test/java/org/jclouds/vcloud/bluelock/compute/BlueLockVCloudComputeServiceLiveTest.java @@ -56,24 +56,24 @@ public class BlueLockVCloudComputeServiceLiveTest extends VCloudComputeServiceLi // TODO verify parsing works } - // https://forums.bluelock.com/showthread.php?p=353#post353 - @Override - @Test(enabled = false) - public void testCreate() throws Exception { - super.testCreate(); - } - - @Override - @Test(enabled = false) - public void testGet() throws Exception { - super.testGet(); - } - - @Override - @Test(enabled = false) - public void testReboot() throws Exception { - super.testReboot(); - } +// // https://forums.bluelock.com/showthread.php?p=353#post353 +// @Override +// @Test(enabled = false) +// public void testCreate() throws Exception { +// super.testCreate(); +// } +// +// @Override +// @Test(enabled = false) +// public void testGet() throws Exception { +// super.testGet(); +// } +// +// @Override +// @Test(enabled = false) +// public void testReboot() throws Exception { +// super.testReboot(); +// } @Test public void testExample() throws Exception { 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 330f72542d..d18353f2a5 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 @@ -124,7 +124,7 @@ public class VCloudComputeServiceContextModule extends VCloudContextModule { @Named("NAMING_CONVENTION") @Singleton String provideNamingConvention() { - return "%s-%d"; + return "%s%d"; } @Singleton @@ -234,11 +234,11 @@ public class VCloudComputeServiceContextModule extends VCloudContextModule { while (node == null && i++ < 3) { try { node = getNodeMetadataByIdInVDC(vdc.getId(), resource.getId()); + nodes.add(node); } catch (NullPointerException e) { logger.warn("vApp %s not yet present in vdc %s", resource.getId(), vdc.getId()); } } - nodes.add(node); } } @@ -281,7 +281,7 @@ public class VCloudComputeServiceContextModule extends VCloudContextModule { protected NodeMetadata getNodeMetadataByIdInVDC(String vDCId, String id) { VApp vApp = client.getVApp(id); - String tag = vApp.getName().replaceAll("-[0-9]+", ""); + String tag = vApp.getName().replaceAll("[0-9]+", ""); return new NodeMetadataImpl(vApp.getId(), vApp.getName(), vDCId, vApp.getLocation(), ImmutableMap. of(), tag, vAppStatusToNodeState.get(vApp .getStatus()), computeClient.getPublicAddresses(id), computeClient diff --git a/vcloud/core/src/main/java/org/jclouds/vcloud/predicates/TaskSuccess.java b/vcloud/core/src/main/java/org/jclouds/vcloud/predicates/TaskSuccess.java index 5d9867747c..0e27e8ed01 100644 --- a/vcloud/core/src/main/java/org/jclouds/vcloud/predicates/TaskSuccess.java +++ b/vcloud/core/src/main/java/org/jclouds/vcloud/predicates/TaskSuccess.java @@ -38,23 +38,25 @@ import com.google.inject.Inject; @Singleton public class TaskSuccess implements Predicate { - private final VCloudClient client; + private final VCloudClient client; - @Resource - protected Logger logger = Logger.NULL; + @Resource + protected Logger logger = Logger.NULL; - @Inject - public TaskSuccess(VCloudClient client) { - this.client = client; - } + @Inject + public TaskSuccess(VCloudClient client) { + this.client = client; + } - public boolean apply(String taskId) { - logger.trace("looking for status on task %s", taskId); + public boolean apply(String taskId) { + logger.trace("looking for status on task %s", taskId); - Task task = client.getTask(taskId); - logger.trace("%s: looking for status %s: currently: %s", task, - TaskStatus.SUCCESS, task.getStatus()); - return task.getStatus() == TaskStatus.SUCCESS; - } + Task task = client.getTask(taskId); + logger.trace("%s: looking for status %s: currently: %s", task, TaskStatus.SUCCESS, task + .getStatus()); + if (task.getStatus() == TaskStatus.ERROR) + throw new RuntimeException("error on task: " + task.getId() + " error: " + task.getError()); + return task.getStatus() == TaskStatus.SUCCESS; + } }