diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/functions/VAppToNodeMetadata.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/functions/VAppToNodeMetadata.java index 9cc7cccdc6..ba998b2391 100644 --- a/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/functions/VAppToNodeMetadata.java +++ b/apis/vcloud/src/main/java/org/jclouds/vcloud/compute/functions/VAppToNodeMetadata.java @@ -24,7 +24,6 @@ import static com.google.common.collect.Iterables.filter; import static org.jclouds.compute.util.ComputeServiceUtils.parseGroupFromName; import static org.jclouds.vcloud.compute.util.VCloudComputeUtils.getCredentialsFrom; import static org.jclouds.vcloud.compute.util.VCloudComputeUtils.getIpsFromVApp; -import static org.jclouds.vcloud.compute.util.VCloudComputeUtils.getVirtualSystemIdentifierOfFirstVMIn; import static org.jclouds.vcloud.compute.util.VCloudComputeUtils.toComputeOs; import java.util.Map; @@ -73,8 +72,6 @@ public class VAppToNodeMetadata implements Function { builder.ids(from.getHref().toASCIIString()); builder.uri(from.getHref()); builder.name(from.getName()); - // not guaranteed to be correct, but good chance - builder.hostname(getVirtualSystemIdentifierOfFirstVMIn(from)); builder.location(findLocationForResourceInVDC.apply(from.getVDC())); builder.group(parseGroupFromName(from.getName())); builder.operatingSystem(toComputeOs(from, null)); diff --git a/apis/vcloud/src/test/java/org/jclouds/vcloud/compute/functions/VAppToNodeMetadataTest.java b/apis/vcloud/src/test/java/org/jclouds/vcloud/compute/functions/VAppToNodeMetadataTest.java index 0ca83622c3..d433e7f3af 100644 --- a/apis/vcloud/src/test/java/org/jclouds/vcloud/compute/functions/VAppToNodeMetadataTest.java +++ b/apis/vcloud/src/test/java/org/jclouds/vcloud/compute/functions/VAppToNodeMetadataTest.java @@ -121,7 +121,6 @@ public class VAppToNodeMetadataTest { VAppToNodeMetadata converter = injector.getInstance(VAppToNodeMetadata.class); NodeMetadata node = converter.apply(result); assertEquals(node.getLocation(), location); - assertEquals(node.getHostname(), "my-app"); assertEquals(node.getPrivateAddresses(), ImmutableSet.of("172.16.7.230")); assertEquals(node.getPublicAddresses(), ImmutableSet.of()); } @@ -136,7 +135,6 @@ public class VAppToNodeMetadataTest { VAppToNodeMetadata converter = injector.getInstance(VAppToNodeMetadata.class); NodeMetadata node = converter.apply(result); assertEquals(node.getLocation(), location); - assertEquals(node.getHostname(), "Centos-5.5_x64"); assertEquals(node.getPrivateAddresses(), ImmutableSet.of()); assertEquals(node.getPublicAddresses(), ImmutableSet.of()); } @@ -151,7 +149,6 @@ public class VAppToNodeMetadataTest { VApp result = factory.create(injector.getInstance(VAppHandler.class)).parse(is); VAppToNodeMetadata converter = injector.getInstance(VAppToNodeMetadata.class); NodeMetadata node = converter.apply(result); - assertEquals(node.getHostname(), ""); assertEquals(node.getLocation(), location); } } diff --git a/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/functions/ServerToNodeMetadata.java b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/functions/ServerToNodeMetadata.java index 56b874f79e..8952029c5b 100644 --- a/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/functions/ServerToNodeMetadata.java +++ b/providers/rimuhosting/src/main/java/org/jclouds/rimuhosting/miro/compute/functions/ServerToNodeMetadata.java @@ -94,6 +94,7 @@ public class ServerToNodeMetadata implements Function { NodeMetadataBuilder builder = new NodeMetadataBuilder(); builder.ids(from.getId() + ""); builder.name(from.getName()); + builder.hostname(from.getName()); Location location = findLocationWithId(from.getLocation().getId()); builder.location(location); builder.group(parseGroupFromName(from.getName())); diff --git a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudComputeServiceLiveTest.java b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudComputeServiceLiveTest.java index 16ad0f7f92..4ed148cc45 100644 --- a/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudComputeServiceLiveTest.java +++ b/providers/stratogen-vcloud-mycloud/src/test/java/org/jclouds/stratogen/vcloud/mycloud/compute/StratoGenVCloudMyCloudComputeServiceLiveTest.java @@ -21,7 +21,9 @@ package org.jclouds.stratogen.vcloud.mycloud.compute; import static org.jclouds.compute.util.ComputeServiceUtils.getCores; import static org.testng.Assert.assertEquals; +import org.jclouds.compute.domain.ExecResponse; import org.jclouds.compute.domain.Image; +import org.jclouds.compute.domain.NodeMetadata; import org.jclouds.compute.domain.OsFamily; import org.jclouds.compute.domain.Template; import org.jclouds.compute.domain.TemplateBuilder; @@ -38,7 +40,8 @@ import org.testng.annotations.Test; public class StratoGenVCloudMyCloudComputeServiceLiveTest extends VCloudComputeServiceLiveTest { public StratoGenVCloudMyCloudComputeServiceLiveTest() { provider = "stratogen-vcloud-mycloud"; - // vcloud requires instantiate before deploy, which takes longer than 30 seconds + // vcloud requires instantiate before deploy, which takes longer than 30 + // seconds nonBlockDurationSeconds = 300; } @@ -67,4 +70,8 @@ public class StratoGenVCloudMyCloudComputeServiceLiveTest extends VCloudComputeS return template; } + protected void checkResponseEqualsHostname(ExecResponse execResponse, NodeMetadata node1) { + // hostname is not predictable based on node metadata + assert execResponse.getOutput().trim().equals("(none)"); + } }