diff --git a/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/CloudServersComputeServiceLiveTest.java b/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/CloudServersComputeServiceLiveTest.java index c273796282..9727268563 100644 --- a/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/CloudServersComputeServiceLiveTest.java +++ b/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/CloudServersComputeServiceLiveTest.java @@ -64,7 +64,7 @@ public class CloudServersComputeServiceLiveTest extends BaseComputeServiceLiveTe } } - @Test(expectedExceptions = UnsupportedOperationException.class) + @Test(enabled = true, dependsOnMethods = "testReboot", expectedExceptions = UnsupportedOperationException.class) public void testSuspendResume() throws Exception { super.testSuspendResume(); } diff --git a/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/functions/ServerToNodeMetadataTest.java b/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/functions/ServerToNodeMetadataTest.java index cc5871d7b2..47eb79ddaa 100644 --- a/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/functions/ServerToNodeMetadataTest.java +++ b/apis/cloudservers/src/test/java/org/jclouds/cloudservers/compute/functions/ServerToNodeMetadataTest.java @@ -75,7 +75,7 @@ public class ServerToNodeMetadataTest { assertEquals(metadata, new NodeMetadataBuilder().state(NodeState.PENDING).publicAddresses( ImmutableSet.of("67.23.10.132", "67.23.10.131")).privateAddresses(ImmutableSet.of("10.176.42.16")).tag( - "NOTAG-sample-server").imageId("2").id("1234").providerId("1234").name("sample-server").credentials( + "NOTAG#sample-server").imageId("2").id("1234").providerId("1234").name("sample-server").credentials( creds).location( new LocationImpl(LocationScope.HOST, "e4d909c290d0fb1ca068ffaddf22cbd0", "e4d909c290d0fb1ca068ffaddf22cbd0", new LocationImpl(LocationScope.ZONE, "dallas", @@ -98,7 +98,7 @@ public class ServerToNodeMetadataTest { assertEquals(metadata, new NodeMetadataBuilder().state(NodeState.PENDING).publicAddresses( ImmutableSet.of("67.23.10.132", "67.23.10.131")).privateAddresses(ImmutableSet.of("10.176.42.16")).tag( - "NOTAG-sample-server").imageId("2").id("1234").providerId("1234").name("sample-server").location( + "NOTAG#sample-server").imageId("2").id("1234").providerId("1234").name("sample-server").location( new LocationImpl(LocationScope.HOST, "e4d909c290d0fb1ca068ffaddf22cbd0", "e4d909c290d0fb1ca068ffaddf22cbd0", new LocationImpl(LocationScope.ZONE, "dallas", "description", null))).userMetadata( @@ -122,7 +122,7 @@ public class ServerToNodeMetadataTest { assertEquals(metadata, new NodeMetadataBuilder().state(NodeState.PENDING).publicAddresses( ImmutableSet.of("67.23.10.132", "67.23.10.131")).privateAddresses(ImmutableSet.of("10.176.42.16")).tag( - "NOTAG-sample-server").imageId("2").operatingSystem( + "NOTAG#sample-server").imageId("2").operatingSystem( new OperatingSystemBuilder().family(OsFamily.CENTOS).description("CentOS 5.2").version("5.2").is64Bit( true).build()).id("1234").providerId("1234").name("sample-server").location( new LocationImpl(LocationScope.HOST, "e4d909c290d0fb1ca068ffaddf22cbd0", @@ -147,7 +147,7 @@ public class ServerToNodeMetadataTest { assertEquals(metadata, new NodeMetadataBuilder().state(NodeState.PENDING).publicAddresses( ImmutableSet.of("67.23.10.132", "67.23.10.131")).privateAddresses(ImmutableSet.of("10.176.42.16")).tag( - "NOTAG-sample-server").imageId("2").hardware( + "NOTAG#sample-server").imageId("2").hardware( new HardwareBuilder().ids("1").name("256 MB Server").processors( ImmutableList.of(new Processor(1.0, 1.0))).ram(256).volumes( ImmutableList.of(new VolumeBuilder().type(Volume.Type.LOCAL).size(10.0f).durable(true) diff --git a/apis/ec2/src/main/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadata.java b/apis/ec2/src/main/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadata.java index 3cac97d04e..a5f265e436 100644 --- a/apis/ec2/src/main/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadata.java +++ b/apis/ec2/src/main/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadata.java @@ -158,7 +158,7 @@ public class RunningInstanceToNodeMetadata implements Function() { diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/compute/functions/CredentialsForInstanceTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/compute/functions/CredentialsForInstanceTest.java index cb3963230a..4a41652874 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/compute/functions/CredentialsForInstanceTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/compute/functions/CredentialsForInstanceTest.java @@ -100,7 +100,7 @@ public class CredentialsForInstanceTest { // // NodeMetadata metadata = parser.apply(instance); // -// assertEquals(metadata.getTag(), "NOTAG-i-3d640055"); +// assertEquals(metadata.getTag(), "NOTAG#i-3d640055"); // assertEquals(metadata.getLocation(), null); // assertEquals(metadata.getImageId(), "us-east-1/ami-1515f07c"); // assertEquals(metadata.getHardware().getId(), "m1.small"); @@ -186,7 +186,7 @@ public class CredentialsForInstanceTest { // // NodeMetadata metadata = parser.apply(instance); // -// assertEquals(metadata.getTag(), "NOTAG-i-3d640055"); +// assertEquals(metadata.getTag(), "NOTAG#i-3d640055"); // assertEquals(metadata.getLocation(), region); // assertEquals(metadata.getImageId(), "us-east-1/ami-1515f07c"); // assertEquals(metadata.getHardware().getId(), "m1.small"); @@ -268,7 +268,7 @@ public class CredentialsForInstanceTest { // // NodeMetadata metadata = parser.apply(instance); // -// assertEquals(metadata.getTag(), "NOTAG-i-3d640055"); +// assertEquals(metadata.getTag(), "NOTAG#i-3d640055"); // assertEquals(metadata.getLocation(), region); // assertEquals(metadata.getImageId(), "us-east-1/ami-1515f07c"); // assertEquals(metadata.getHardware(), null); @@ -344,7 +344,7 @@ public class CredentialsForInstanceTest { // // NodeMetadata metadata = parser.apply(instance); // -// assertEquals(metadata.getTag(), "NOTAG-i-3d640055"); +// assertEquals(metadata.getTag(), "NOTAG#i-3d640055"); // assertEquals(metadata.getLocation(), region); // assertEquals(metadata.getImageId(), "us-east-1/ami-1515f07c"); // assertEquals(metadata.getHardware().getId(), "m1.small"); @@ -418,7 +418,7 @@ public class CredentialsForInstanceTest { // NodeMetadata metadata = parser.apply(instance); // assertEquals(metadata.getLocation(), locations.get().iterator().next()); // assertEquals(metadata.getImageId(), "us-east-1/imageId"); -// assertEquals(metadata.getTag(), "NOTAG-id"); +// assertEquals(metadata.getTag(), "NOTAG#id"); // assertEquals(metadata.getCredentials(), null); // // verify(imageMap); @@ -480,7 +480,7 @@ public class CredentialsForInstanceTest { // NodeMetadata metadata = parser.apply(instance); // assertEquals(metadata.getLocation(), locations.get().iterator().next()); // assertEquals(metadata.getImageId(), "us-east-1/imageId"); -// assertEquals(metadata.getTag(), "NOTAG-id"); +// assertEquals(metadata.getTag(), "NOTAG#id"); // assertEquals(metadata.getCredentials(), null); // // verify(imageMap); @@ -546,7 +546,7 @@ public class CredentialsForInstanceTest { // NodeMetadata metadata = parser.apply(instance); // assertEquals(metadata.getLocation(), locations.get().iterator().next()); // assertEquals(metadata.getImageId(), lateImage.getId()); -// assertEquals(metadata.getTag(), "NOTAG-id"); +// assertEquals(metadata.getTag(), "NOTAG#id"); // assertEquals(metadata.getCredentials(), null); // // verify(lateImage); @@ -609,7 +609,7 @@ public class CredentialsForInstanceTest { // NodeMetadata metadata = parser.apply(instance); // assertEquals(metadata.getLocation(), locations.get().iterator().next()); // assertEquals(metadata.getImageId(), "us-east-1/imageId"); -// assertEquals(metadata.getTag(), "NOTAG-id"); +// assertEquals(metadata.getTag(), "NOTAG#id"); // assertEquals(metadata.getCredentials(), null); // // verify(imageMap); @@ -815,7 +815,7 @@ public class CredentialsForInstanceTest { // // NodeMetadata metadata = parser.apply(instance); // -// assertEquals(metadata.getTag(), "NOTAG-id"); +// assertEquals(metadata.getTag(), "NOTAG#id"); // assertEquals(metadata.getLocation(), location); // assertEquals(metadata.getImageId(), "us-east-1/imageId"); // diff --git a/apis/ec2/src/test/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadataTest.java b/apis/ec2/src/test/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadataTest.java index f1406e49df..c2bd88e7ad 100644 --- a/apis/ec2/src/test/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadataTest.java +++ b/apis/ec2/src/test/java/org/jclouds/ec2/compute/functions/RunningInstanceToNodeMetadataTest.java @@ -83,7 +83,7 @@ public class RunningInstanceToNodeMetadataTest { RunningInstance server = firstInstanceFromResource("/describe_instances_nova.xml"); assertEquals(parser.apply(server), new NodeMetadataBuilder().state(NodeState.TERMINATED).publicAddresses( - ImmutableSet. of()).privateAddresses(ImmutableSet.of("10.128.207.5")).tag("NOTAG-i-9slweygo") + ImmutableSet. of()).privateAddresses(ImmutableSet.of("10.128.207.5")).tag("NOTAG#i-9slweygo") .credentials(creds).imageId("us-east-1/ami-25CB1213").id("us-east-1/i-9slweygo") .providerId("i-9slweygo").build()); } @@ -96,7 +96,7 @@ public class RunningInstanceToNodeMetadataTest { RunningInstance server = firstInstanceFromResource("/describe_instances_nova.xml"); assertEquals(parser.apply(server), new NodeMetadataBuilder().state(NodeState.TERMINATED).publicAddresses( - ImmutableSet. of()).privateAddresses(ImmutableSet.of("10.128.207.5")).tag("NOTAG-i-9slweygo") + ImmutableSet. of()).privateAddresses(ImmutableSet.of("10.128.207.5")).tag("NOTAG#i-9slweygo") .imageId("us-east-1/ami-25CB1213").id("us-east-1/i-9slweygo").providerId("i-9slweygo").build()); } @@ -108,7 +108,7 @@ public class RunningInstanceToNodeMetadataTest { RunningInstance server = firstInstanceFromResource("/describe_instances_nova.xml"); assertEquals(parser.apply(server), new NodeMetadataBuilder().state(NodeState.TERMINATED).privateAddresses( - ImmutableSet.of("10.128.207.5")).tag("NOTAG-i-9slweygo").imageId("us-east-1/ami-25CB1213").id( + ImmutableSet.of("10.128.207.5")).tag("NOTAG#i-9slweygo").imageId("us-east-1/ami-25CB1213").id( "us-east-1/i-9slweygo").providerId("i-9slweygo").location(provider).build()); } @@ -120,7 +120,7 @@ public class RunningInstanceToNodeMetadataTest { RunningInstance server = firstInstanceFromResource("/describe_instances_nova.xml"); assertEquals(parser.apply(server), new NodeMetadataBuilder().state(NodeState.TERMINATED).privateAddresses( - ImmutableSet.of("10.128.207.5")).tag("NOTAG-i-9slweygo").imageId("us-east-1/ami-25CB1213") + ImmutableSet.of("10.128.207.5")).tag("NOTAG#i-9slweygo").imageId("us-east-1/ami-25CB1213") .operatingSystem( new OperatingSystemBuilder().family(OsFamily.UBUNTU).version("9.10").arch("paravirtual") .description("nebula/ubuntu-karmic").is64Bit(true).build()).id("us-east-1/i-9slweygo") @@ -136,7 +136,7 @@ public class RunningInstanceToNodeMetadataTest { RunningInstance server = firstInstanceFromResource("/describe_instances_nova.xml"); assertEquals(parser.apply(server), new NodeMetadataBuilder().state(NodeState.TERMINATED).privateAddresses( - ImmutableSet.of("10.128.207.5")).tag("NOTAG-i-9slweygo").imageId("us-east-1/ami-25CB1213").hardware( + ImmutableSet.of("10.128.207.5")).tag("NOTAG#i-9slweygo").imageId("us-east-1/ami-25CB1213").hardware( m1_small().build()).operatingSystem( new OperatingSystemBuilder().family(OsFamily.UBUNTU).version("9.10").arch("paravirtual").description( "nebula/ubuntu-karmic").is64Bit(true).build()).id("us-east-1/i-9slweygo").providerId( @@ -165,7 +165,7 @@ public class RunningInstanceToNodeMetadataTest { RunningInstance server = firstInstanceFromResource("/describe_instances_nova.xml"); assertEquals(parser.apply(server), new NodeMetadataBuilder().state(NodeState.TERMINATED).privateAddresses( - ImmutableSet.of("10.128.207.5")).tag("NOTAG-i-9slweygo").imageId("us-east-1/ami-25CB1213").id( + ImmutableSet.of("10.128.207.5")).tag("NOTAG#i-9slweygo").imageId("us-east-1/ami-25CB1213").id( "us-east-1/i-9slweygo").providerId("i-9slweygo").hardware(m1_small().build()).location( provider).build()); } @@ -298,7 +298,7 @@ public class RunningInstanceToNodeMetadataTest { // // NodeMetadata metadata = parser.apply(instance); // - // assertEquals(metadata.getTag(), "NOTAG-i-3d640055"); + // assertEquals(metadata.getTag(), "NOTAG#i-3d640055"); // assertEquals(metadata.getLocation(), null); // assertEquals(metadata.getImageId(), "us-east-1/ami-1515f07c"); // assertEquals(metadata.getHardware().getId(), "m1.small"); @@ -395,7 +395,7 @@ public class RunningInstanceToNodeMetadataTest { // // NodeMetadata metadata = parser.apply(instance); // - // assertEquals(metadata.getTag(), "NOTAG-i-3d640055"); + // assertEquals(metadata.getTag(), "NOTAG#i-3d640055"); // assertEquals(metadata.getLocation(), region); // assertEquals(metadata.getImageId(), "us-east-1/ami-1515f07c"); // assertEquals(metadata.getHardware().getId(), "m1.small"); @@ -486,7 +486,7 @@ public class RunningInstanceToNodeMetadataTest { // // NodeMetadata metadata = parser.apply(instance); // - // assertEquals(metadata.getTag(), "NOTAG-i-3d640055"); + // assertEquals(metadata.getTag(), "NOTAG#i-3d640055"); // assertEquals(metadata.getLocation(), region); // assertEquals(metadata.getImageId(), "us-east-1/ami-1515f07c"); // assertEquals(metadata.getHardware(), null); @@ -570,7 +570,7 @@ public class RunningInstanceToNodeMetadataTest { // // NodeMetadata metadata = parser.apply(instance); // - // assertEquals(metadata.getTag(), "NOTAG-i-3d640055"); + // assertEquals(metadata.getTag(), "NOTAG#i-3d640055"); // assertEquals(metadata.getLocation(), region); // assertEquals(metadata.getImageId(), "us-east-1/ami-1515f07c"); // assertEquals(metadata.getHardware().getId(), "m1.small"); @@ -651,7 +651,7 @@ public class RunningInstanceToNodeMetadataTest { // NodeMetadata metadata = parser.apply(instance); // assertEquals(metadata.getLocation(), locations.get().iterator().next()); // assertEquals(metadata.getImageId(), "us-east-1/imageId"); - // assertEquals(metadata.getTag(), "NOTAG-id"); + // assertEquals(metadata.getTag(), "NOTAG#id"); // assertEquals(metadata.getCredentials(), null); // // verify(imageMap); @@ -719,7 +719,7 @@ public class RunningInstanceToNodeMetadataTest { // NodeMetadata metadata = parser.apply(instance); // assertEquals(metadata.getLocation(), locations.get().iterator().next()); // assertEquals(metadata.getImageId(), "us-east-1/imageId"); - // assertEquals(metadata.getTag(), "NOTAG-id"); + // assertEquals(metadata.getTag(), "NOTAG#id"); // assertEquals(metadata.getCredentials(), null); // // verify(imageMap); @@ -792,7 +792,7 @@ public class RunningInstanceToNodeMetadataTest { // NodeMetadata metadata = parser.apply(instance); // assertEquals(metadata.getLocation(), locations.get().iterator().next()); // assertEquals(metadata.getImageId(), lateImage.getId()); - // assertEquals(metadata.getTag(), "NOTAG-id"); + // assertEquals(metadata.getTag(), "NOTAG#id"); // assertEquals(metadata.getCredentials(), null); // // verify(lateImage); @@ -861,7 +861,7 @@ public class RunningInstanceToNodeMetadataTest { // NodeMetadata metadata = parser.apply(instance); // assertEquals(metadata.getLocation(), locations.get().iterator().next()); // assertEquals(metadata.getImageId(), "us-east-1/imageId"); - // assertEquals(metadata.getTag(), "NOTAG-id"); + // assertEquals(metadata.getTag(), "NOTAG#id"); // assertEquals(metadata.getCredentials(), null); // // verify(imageMap); @@ -1087,7 +1087,7 @@ public class RunningInstanceToNodeMetadataTest { // // NodeMetadata metadata = parser.apply(instance); // - // assertEquals(metadata.getTag(), "NOTAG-id"); + // assertEquals(metadata.getTag(), "NOTAG#id"); // assertEquals(metadata.getLocation(), location); // assertEquals(metadata.getImageId(), "us-east-1/imageId"); // diff --git a/compute/src/main/java/org/jclouds/compute/util/ComputeServiceUtils.java b/compute/src/main/java/org/jclouds/compute/util/ComputeServiceUtils.java index 3ddedefe95..06a38e5652 100644 --- a/compute/src/main/java/org/jclouds/compute/util/ComputeServiceUtils.java +++ b/compute/src/main/java/org/jclouds/compute/util/ComputeServiceUtils.java @@ -62,7 +62,7 @@ import com.google.common.collect.Iterables; * @author Adrian Cole */ public class ComputeServiceUtils { - public static final Pattern DELIMETED_BY_HYPHEN_ENDING_IN_HYPHEN_HEX = Pattern.compile("([^-]+)-[0-9a-f]+"); + public static final Pattern DELIMETED_BY_HYPHEN_ENDING_IN_HYPHEN_HEX = Pattern.compile("(.+)-[0-9a-f]+"); /** * build a shell script that invokes the contents of the http request in bash. @@ -106,7 +106,7 @@ public class ComputeServiceUtils { public static String parseTagFromName(String from) { Matcher matcher = DELIMETED_BY_HYPHEN_ENDING_IN_HYPHEN_HEX.matcher(from); - return matcher.find() ? matcher.group(1) : "NOTAG-" + from; + return matcher.find() ? matcher.group(1) : "NOTAG#" + from; } public static double getCores(Hardware input) {