From b20cc1669352e75cecf3484920a767b3eb32c218 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Fri, 2 Sep 2011 13:43:57 -0700 Subject: [PATCH] Issue 677:Race in authorizeGroupToItself and node launch --- .../ec2/compute/functions/CreateSecurityGroupIfNeeded.java | 4 ++-- .../aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apis/ec2/src/main/java/org/jclouds/ec2/compute/functions/CreateSecurityGroupIfNeeded.java b/apis/ec2/src/main/java/org/jclouds/ec2/compute/functions/CreateSecurityGroupIfNeeded.java index 620de15f90..10d7c6552c 100644 --- a/apis/ec2/src/main/java/org/jclouds/ec2/compute/functions/CreateSecurityGroupIfNeeded.java +++ b/apis/ec2/src/main/java/org/jclouds/ec2/compute/functions/CreateSecurityGroupIfNeeded.java @@ -84,8 +84,8 @@ public class CreateSecurityGroupIfNeeded implements Function> authorizing securityGroup region(%s) name(%s) permission to itself", region, name); - String myOwnerId = Iterables.get(ec2Client.getSecurityGroupServices().describeSecurityGroupsInRegion(region), 0) - .getOwnerId(); + String myOwnerId = Iterables.get( + ec2Client.getSecurityGroupServices().describeSecurityGroupsInRegion(region, name), 0).getOwnerId(); ec2Client.getSecurityGroupServices().authorizeSecurityGroupIngressInRegion(region, name, new UserIdGroupPair(myOwnerId, name)); logger.debug("<< authorized securityGroup(%s)", name); diff --git a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java index a396a6dee2..85675ca761 100644 --- a/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java +++ b/providers/aws-ec2/src/test/java/org/jclouds/aws/ec2/compute/AWSEC2TemplateBuilderLiveTest.java @@ -141,7 +141,7 @@ public class AWSEC2TemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { Template defaultTemplate = context.getComputeService().templateBuilder().build(); assert (defaultTemplate.getImage().getProviderId().startsWith("ami-")) : defaultTemplate; - assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "2011.02.1"); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "2011.09.rc-1"); assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), true); assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.AMZN_LINUX); assertEquals(defaultTemplate.getImage().getUserMetadata().get("rootDeviceType"), "ebs"); @@ -157,7 +157,7 @@ public class AWSEC2TemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { Template defaultTemplate = context.getComputeService().templateBuilder().osFamily(OsFamily.AMZN_LINUX) .imageMatches(EC2ImagePredicates.rootDeviceType(RootDeviceType.INSTANCE_STORE)).build(); assert (defaultTemplate.getImage().getProviderId().startsWith("ami-")) : defaultTemplate; - assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "2011.02.1"); + assertEquals(defaultTemplate.getImage().getOperatingSystem().getVersion(), "2011.09.rc-1"); assertEquals(defaultTemplate.getImage().getOperatingSystem().is64Bit(), false); assertEquals(defaultTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.AMZN_LINUX); assertEquals(defaultTemplate.getImage().getUserMetadata().get("rootDeviceType"), "instance-store"); @@ -172,7 +172,7 @@ public class AWSEC2TemplateBuilderLiveTest extends BaseTemplateBuilderLiveTest { .build(); assert (fastestTemplate.getImage().getProviderId().startsWith("ami-")) : fastestTemplate; assertEquals(fastestTemplate.getHardware().getProviderId(), InstanceType.CC1_4XLARGE); - assertEquals(fastestTemplate.getImage().getOperatingSystem().getVersion(), "2011.02.1-beta"); + assertEquals(fastestTemplate.getImage().getOperatingSystem().getVersion(), "2011.09.rc-1"); assertEquals(fastestTemplate.getImage().getOperatingSystem().is64Bit(), true); assertEquals(fastestTemplate.getImage().getOperatingSystem().getFamily(), OsFamily.AMZN_LINUX); assertEquals(fastestTemplate.getImage().getUserMetadata().get("rootDeviceType"), "ebs");