diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/config/EC2ComputeServiceContextModule.java b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/config/EC2ComputeServiceContextModule.java index b3d40d3809..14427df55e 100755 --- a/aws/core/src/main/java/org/jclouds/aws/ec2/compute/config/EC2ComputeServiceContextModule.java +++ b/aws/core/src/main/java/org/jclouds/aws/ec2/compute/config/EC2ComputeServiceContextModule.java @@ -373,7 +373,8 @@ public class EC2ComputeServiceContextModule extends AbstractModule { } }); for (String zone : availabilityZoneToRegionMap.keySet()) { - locations.add(new LocationImpl(LocationScope.ZONE, zone, zone, idToLocation.get(zone))); + locations.add(new LocationImpl(LocationScope.ZONE, zone, zone, idToLocation.get(availabilityZoneToRegionMap + .get(zone)))); } return locations; } diff --git a/aws/core/src/main/java/org/jclouds/aws/ec2/xml/BaseReservationHandler.java b/aws/core/src/main/java/org/jclouds/aws/ec2/xml/BaseReservationHandler.java index 8ee30d0e2c..f023aa7014 100644 --- a/aws/core/src/main/java/org/jclouds/aws/ec2/xml/BaseReservationHandler.java +++ b/aws/core/src/main/java/org/jclouds/aws/ec2/xml/BaseReservationHandler.java @@ -236,7 +236,7 @@ public abstract class BaseReservationHandler extends HandlerForGeneratedReque region = defaultRegion; instances.add(new RunningInstance(region, groupIds, amiLaunchIndex, dnsName, imageId, instanceId, instanceState, instanceType, ipAddress, kernelId, keyName, launchTime, monitoring, availabilityZone, - placementGroup, platform, privateDnsName, privateIpAddress, virtualizationType, productCodes, + placementGroup, virtualizationType, platform, privateDnsName, privateIpAddress, productCodes, ramdiskId, reason, subnetId, vpcId, rootDeviceType, rootDeviceName, ebsBlockDevices)); this.amiLaunchIndex = null; this.dnsName = null; diff --git a/aws/core/src/test/java/org/jclouds/aws/ec2/compute/EC2ComputeServiceLiveTest.java b/aws/core/src/test/java/org/jclouds/aws/ec2/compute/EC2ComputeServiceLiveTest.java index ced6b1c956..6c8306dc7b 100644 --- a/aws/core/src/test/java/org/jclouds/aws/ec2/compute/EC2ComputeServiceLiveTest.java +++ b/aws/core/src/test/java/org/jclouds/aws/ec2/compute/EC2ComputeServiceLiveTest.java @@ -184,11 +184,12 @@ public class EC2ComputeServiceLiveTest extends BaseComputeServiceLiveTest { assertEquals(instance.getKeyName(), null); // make sure we made our dummy group and also let in the user's group - assertEquals(instance.getGroupIds(), ImmutableSet. of(tag, "jclouds#" + tag)); + assertEquals(instance.getGroupIds(), ImmutableSet. of(tag, String.format("jclouds#%s#%s", tag, + instance.getRegion()))); // make sure our dummy group has no rules - SecurityGroup group = Iterables.getOnlyElement(securityGroupClient.describeSecurityGroupsInRegion(null, - "jclouds#" + tag)); + SecurityGroup group = Iterables.getOnlyElement(securityGroupClient.describeSecurityGroupsInRegion(null, String + .format("jclouds#%s#%s", tag, instance.getRegion()))); assert group.getIpPermissions().size() == 0 : group; } finally { @@ -268,7 +269,8 @@ public class EC2ComputeServiceLiveTest extends BaseComputeServiceLiveTest { return instance; } - private void cleanupExtendedStuff(SecurityGroupClient securityGroupClient, KeyPairClient keyPairClient, String tag) { + private void cleanupExtendedStuff(SecurityGroupClient securityGroupClient, KeyPairClient keyPairClient, String tag) + throws InterruptedException { try { securityGroupClient.deleteSecurityGroupInRegion(null, tag); } catch (Exception e) { @@ -279,6 +281,7 @@ public class EC2ComputeServiceLiveTest extends BaseComputeServiceLiveTest { } catch (Exception e) { } + Thread.sleep(2000); } } diff --git a/aws/core/src/test/java/org/jclouds/aws/ec2/xml/DescribeInstancesResponseHandlerTest.java b/aws/core/src/test/java/org/jclouds/aws/ec2/xml/DescribeInstancesResponseHandlerTest.java index dad55cb178..59bad9f49a 100644 --- a/aws/core/src/test/java/org/jclouds/aws/ec2/xml/DescribeInstancesResponseHandlerTest.java +++ b/aws/core/src/test/java/org/jclouds/aws/ec2/xml/DescribeInstancesResponseHandlerTest.java @@ -73,8 +73,8 @@ public class DescribeInstancesResponseHandlerTest extends BaseEC2HandlerTest { "ec2-174-129-81-68.compute-1.amazonaws.com", "ami-1fd73376", "i-0799056f", InstanceState.RUNNING, InstanceType.M1_SMALL, "174.129.81.68", "aki-a71cf9ce", "adriancole.ec21", dateService.iso8601DateParse("2009-11-09T03:00:34.000Z"), false, - AvailabilityZone.US_EAST_1C, null, null, "ip-10-243-42-70.ec2.internal", "10.243.42.70", - "paravirtual", ImmutableSet. of(), "ari-a51cf9cc", null, null, null, + AvailabilityZone.US_EAST_1C, null, "paravirtual", null, "ip-10-243-42-70.ec2.internal", + "10.243.42.70", ImmutableSet. of(), "ari-a51cf9cc", null, null, null, RootDeviceType.INSTANCE_STORE, null, ImmutableMap. of())), "993194456877", null, "r-a3c508cb")); @@ -92,13 +92,13 @@ public class DescribeInstancesResponseHandlerTest extends BaseEC2HandlerTest { defaultRegion, ImmutableSet.of("default"), "23", "ec2-72-44-33-4.compute-1.amazonaws.com", "ami-6ea54007", "i-28a64341", InstanceState.RUNNING, InstanceType.M1_LARGE, (String) null, "aki-ba3adfd3", "example-key-name", dateService.iso8601DateParse("2007-08-07T11:54:42.000Z"), false, - AvailabilityZone.US_EAST_1B, null, null, "10-251-50-132.ec2.internal", null, "paravirtual", ImmutableSet + AvailabilityZone.US_EAST_1B, null, "paravirtual", null, "10-251-50-132.ec2.internal", null, ImmutableSet .of("774F4FF8"), "ari-badbad00", null, null, null, RootDeviceType.INSTANCE_STORE, null, ImmutableMap. of()), new RunningInstance(defaultRegion, ImmutableSet .of("default"), "23", "ec2-72-44-33-6.compute-1.amazonaws.com", "ami-6ea54007", "i-28a64435", InstanceState.RUNNING, InstanceType.M1_LARGE, (String) null, "aki-ba3adfd3", "example-key-name", dateService.iso8601DateParse("2007-08-07T11:54:42.000Z"), false, AvailabilityZone.US_EAST_1B, null, - null, "10-251-50-134.ec2.internal", null, "paravirtual", ImmutableSet.of("774F4FF8"), "ari-badbad00", + "paravirtual", null, "10-251-50-134.ec2.internal", null, ImmutableSet.of("774F4FF8"), "ari-badbad00", null, null, null, RootDeviceType.INSTANCE_STORE, null, ImmutableMap. of())), "UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM", null, "r-44a5402d")); @@ -117,8 +117,8 @@ public class DescribeInstancesResponseHandlerTest extends BaseEC2HandlerTest { contents.add(new Reservation(defaultRegion, ImmutableSet.of("default"), ImmutableSet.of(new RunningInstance( defaultRegion, ImmutableSet.of("jclouds#euc"), "1", null, "emi-9ACB1363", "i-3FFA0762", InstanceState.SHUTTING_DOWN, InstanceType.M1_LARGE, null, "eki-6CBD12F2", "jclouds#euc-17", dateService - .iso8601DateParse("2010-06-16T03:06:19.000Z"), false, "open", null, null, "10.7.0.179", null, - "paravirtual", ImmutableSet. of(), "eri-A97113E4", null, null, null, + .iso8601DateParse("2010-06-16T03:06:19.000Z"), false, "open", null, "paravirtual", null, + "10.7.0.179", null, ImmutableSet. of(), "eri-A97113E4", null, null, null, RootDeviceType.INSTANCE_STORE, null, ImmutableMap. of())), "jclouds", null, "r-4D2A08AD")); @@ -137,8 +137,8 @@ public class DescribeInstancesResponseHandlerTest extends BaseEC2HandlerTest { "ec2-75-101-203-146.compute-1.amazonaws.com", "ami-849875ed", "i-e564438d", InstanceState.RUNNING, InstanceType.M1_SMALL, "75.101.203.146", "aki-a71cf9ce", "adriancole.ec2ebs1", dateService.iso8601DateParse("2009-12-30T04:06:23.000Z"), false, - AvailabilityZone.US_EAST_1B, "placement", null, "domU-12-31-39-09-CE-53.compute-1.internal", - "10.210.209.157", "hvm", ImmutableSet. of(), "ari-a51cf9cc", null, null, null, + AvailabilityZone.US_EAST_1B, "placement","hvm", null, "domU-12-31-39-09-CE-53.compute-1.internal", + "10.210.209.157", ImmutableSet. of(), "ari-a51cf9cc", null, null, null, RootDeviceType.EBS, "/dev/sda1", ImmutableMap. of("/dev/sda1", new EbsBlockDevice("vol-dc6ca8b5", Attachment.Status.ATTACHED, dateService .iso8601DateParse("2009-12-30T04:06:29.000Z"), true)))), "993194456877", diff --git a/aws/core/src/test/java/org/jclouds/aws/ec2/xml/RunInstancesResponseHandlerTest.java b/aws/core/src/test/java/org/jclouds/aws/ec2/xml/RunInstancesResponseHandlerTest.java index 4e7849fa1b..7b71028b32 100644 --- a/aws/core/src/test/java/org/jclouds/aws/ec2/xml/RunInstancesResponseHandlerTest.java +++ b/aws/core/src/test/java/org/jclouds/aws/ec2/xml/RunInstancesResponseHandlerTest.java @@ -68,17 +68,17 @@ public class RunInstancesResponseHandlerTest extends BaseEC2HandlerTest { new RunningInstance(defaultRegion, ImmutableSet.of("default"), "0", null, "ami-60a54009", "i-2ba64342", InstanceState.PENDING, InstanceType.M1_SMALL, (String) null, null, "example-key-name", dateService.iso8601DateParse("2007-08-07T11:51:50.000Z"), true, AvailabilityZone.US_EAST_1B, - null, null, (String) null, null, "paravirtual", Sets. newLinkedHashSet(), null, null, + null, "paravirtual", null, (String) null, null, Sets. newLinkedHashSet(), null, null, null, null, RootDeviceType.INSTANCE_STORE, null, ImmutableMap. of()), new RunningInstance(defaultRegion, ImmutableSet.of("default"), "1", null, "ami-60a54009", "i-2bc64242", InstanceState.PENDING, InstanceType.M1_SMALL, (String) null, null, "example-key-name", dateService.iso8601DateParse("2007-08-07T11:51:50.000Z"), true, AvailabilityZone.US_EAST_1B, - null, null, (String) null, null, "paravirtual", Sets. newLinkedHashSet(), null, null, + null, "paravirtual", null, (String) null, null, Sets. newLinkedHashSet(), null, null, null, null, RootDeviceType.INSTANCE_STORE, null, ImmutableMap. of()), new RunningInstance(defaultRegion, ImmutableSet.of("default"), "2", null, "ami-60a54009", "i-2be64332", InstanceState.PENDING, InstanceType.M1_SMALL, (String) null, null, "example-key-name", dateService.iso8601DateParse("2007-08-07T11:51:50.000Z"), true, AvailabilityZone.US_EAST_1B, - null, null, (String) null, null, "paravirtual", Sets. newLinkedHashSet(), null, null, + null, "paravirtual", null, (String) null, null, Sets. newLinkedHashSet(), null, null, null, null, RootDeviceType.INSTANCE_STORE, null, ImmutableMap. of()) ), "AIDADH4IGTRXXKCD", null, "r-47a5402e");