EC2ImageParser was not setting the name

This commit is contained in:
Richard Downer 2012-02-01 16:57:05 +00:00 committed by Andrei Savu
parent 223b5b6316
commit 7c9fb31d0f
2 changed files with 5 additions and 4 deletions

View File

@ -86,6 +86,7 @@ public class EC2ImageParser implements Function<org.jclouds.ec2.domain.Image, Im
ImageBuilder builder = new ImageBuilder(); ImageBuilder builder = new ImageBuilder();
builder.providerId(from.getId()); builder.providerId(from.getId());
builder.id(from.getRegion() + "/" + from.getId()); builder.id(from.getRegion() + "/" + from.getId());
builder.name(from.getName());
builder.description(from.getDescription() != null ? from.getDescription() : from.getImageLocation()); builder.description(from.getDescription() != null ? from.getDescription() : from.getImageLocation());
builder.userMetadata(ImmutableMap.<String, String> builder().put("owner", from.getImageOwnerId()).put( builder.userMetadata(ImmutableMap.<String, String> builder().put("owner", from.getImageOwnerId()).put(
"rootDeviceType", from.getRootDeviceType().value()).put("virtualizationType", "rootDeviceType", from.getRootDeviceType().value()).put("virtualizationType",

View File

@ -61,16 +61,16 @@ public class EC2ImageParserTest {
assertEquals(Iterables.get(result, 0), new ImageBuilder().operatingSystem( assertEquals(Iterables.get(result, 0), new ImageBuilder().operatingSystem(
new OperatingSystem.Builder().family(OsFamily.UNRECOGNIZED).arch("paravirtual").version("").description( new OperatingSystem.Builder().family(OsFamily.UNRECOGNIZED).arch("paravirtual").version("").description(
"137112412989/amzn-ami-0.9.7-beta.i386-ebs").is64Bit(false).build()).description("Amazon") "137112412989/amzn-ami-0.9.7-beta.i386-ebs").is64Bit(false).build()).description("Amazon")
.defaultCredentials(new LoginCredentials("ec2-user", false)).id("us-east-1/ami-82e4b5c7").providerId( .defaultCredentials(new LoginCredentials("ec2-user", false)).id("us-east-1/ami-82e4b5c7").name("amzn-ami-0.9.7-beta.i386-ebs")
"ami-82e4b5c7").location(defaultLocation).userMetadata( .providerId("ami-82e4b5c7").location(defaultLocation).userMetadata(
ImmutableMap.of("owner", "137112412989", "rootDeviceType", "ebs")).build()); ImmutableMap.of("owner", "137112412989", "rootDeviceType", "ebs")).build());
assertEquals(Iterables.get(result, 3), new ImageBuilder().operatingSystem( assertEquals(Iterables.get(result, 3), new ImageBuilder().operatingSystem(
new OperatingSystem.Builder().family(OsFamily.UNRECOGNIZED).arch("paravirtual").version("").description( new OperatingSystem.Builder().family(OsFamily.UNRECOGNIZED).arch("paravirtual").version("").description(
"amzn-ami-us-west-1/amzn-ami-0.9.7-beta.x86_64.manifest.xml").is64Bit(true).build()) "amzn-ami-us-west-1/amzn-ami-0.9.7-beta.x86_64.manifest.xml").is64Bit(true).build())
.description("Amazon Linux AMI x86_64 S3").defaultCredentials(new LoginCredentials("ec2-user", false)).id( .description("Amazon Linux AMI x86_64 S3").defaultCredentials(new LoginCredentials("ec2-user", false)).id(
"us-east-1/ami-f2e4b5b7").providerId("ami-f2e4b5b7").location(defaultLocation).userMetadata( "us-east-1/ami-f2e4b5b7").providerId("ami-f2e4b5b7").name("amzn-ami-0.9.7-beta.x86_64-S3").location(defaultLocation)
ImmutableMap.of("owner", "137112412989", "rootDeviceType", "ebs")).build()); .userMetadata(ImmutableMap.of("owner", "137112412989", "rootDeviceType", "ebs")).build());
} }
static Location defaultLocation = new LocationBuilder().scope(LocationScope.REGION).id("us-east-1").description( static Location defaultLocation = new LocationBuilder().scope(LocationScope.REGION).id("us-east-1").description(