mirror of https://github.com/apache/jclouds.git
version to joyent image
This commit is contained in:
parent
3d1a2dd7fa
commit
4f2232e6da
|
@ -56,9 +56,15 @@ public class DatasetInDatacenterToImage implements Function<DatasetInDatacenter,
|
|||
Location location = locationIndex.get().get(datasetInDatacenter.getDatacenter());
|
||||
checkState(location != null, "location %s not in locationIndex: %s", datasetInDatacenter.getDatacenter(),
|
||||
locationIndex.get());
|
||||
Dataset image = datasetInDatacenter.getDataset();
|
||||
return new ImageBuilder().id(datasetInDatacenter.slashEncode()).providerId(image.getId()).name(image.getName())
|
||||
.operatingSystem(imageToOs.apply(image)).description(image.getName()).location(location)
|
||||
Dataset dataset = datasetInDatacenter.getDataset();
|
||||
return new ImageBuilder()
|
||||
.id(datasetInDatacenter.slashEncode())
|
||||
.providerId(dataset.getId())
|
||||
.name(dataset.getName())
|
||||
.operatingSystem(imageToOs.apply(dataset))
|
||||
.description(dataset.getUrn())
|
||||
.version(dataset.getVersion())
|
||||
.location(location)
|
||||
.status(Image.Status.AVAILABLE).build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,6 +72,8 @@ public class DatasetInDatacenterToImageTest {
|
|||
assertEquals(convertedImage.getName(), datasetToConvert.getName());
|
||||
assertEquals(convertedImage.getStatus(), org.jclouds.compute.domain.Image.Status.AVAILABLE);
|
||||
assertEquals(convertedImage.getOperatingSystem(), operatingSystem);
|
||||
assertEquals(convertedImage.getDescription(), datasetToConvert.getUrn());
|
||||
assertEquals(convertedImage.getVersion(), datasetToConvert.getVersion());
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = IllegalStateException.class)
|
||||
|
|
Loading…
Reference in New Issue