formatting

git-svn-id: http://jclouds.googlecode.com/svn/trunk@2655 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
adrian.f.cole 2010-01-14 20:40:39 +00:00
parent 2e138bebe3
commit 63073ae3f4
1 changed files with 8 additions and 9 deletions

View File

@ -199,15 +199,14 @@ public class EBSBootEC2ClientLiveTest {
while (instance == null) { while (instance == null) {
try { try {
System.out.printf("%d: running instance%n", System.currentTimeMillis()); System.out.printf("%d: running instance%n", System.currentTimeMillis());
instance = client.getInstanceServices().runInstancesInRegion( Reservation reservation = client.getInstanceServices().runInstancesInRegion(
Region.DEFAULT, Region.DEFAULT, null, // allow ec2 to chose an availability zone
null, imageId, 1, // minimum instances
imageId, 1, // maximum instances
1, withKeyName(keyPair.getKeyName())// key I created above
1, .asType(InstanceType.M1_SMALL)// smallest instance size
withKeyName(keyPair.getKeyName()).asType(InstanceType.M1_SMALL) .withSecurityGroup(securityGroupName));// group I created above
.withSecurityGroup(securityGroupName)).getRunningInstances() instance = Iterables.getOnlyElement(reservation.getRunningInstances());
.iterator().next();
} catch (HttpResponseException htpe) { } catch (HttpResponseException htpe) {
if (htpe.getResponse().getStatusCode() == 400) if (htpe.getResponse().getStatusCode() == 400)
continue; continue;