use of org.platformlayer.service.imagefactory.OperatingSystem.Distribution in project platformlayer by platformlayer.
the class DiskImageController method getRequestedOperatingSystem.
protected OperatingSystem getRequestedOperatingSystem(DiskImageRecipe recipe) {
OperatingSystemRecipe operatingSystemRecipe = recipe.operatingSystem;
if (operatingSystemRecipe == null) {
operatingSystemRecipe = new OperatingSystemRecipe();
}
if (Strings.isNullOrEmpty(operatingSystemRecipe.distribution)) {
return OperatingSystem.DebianSqueeze;
}
Distribution distribution = Distribution.parse(operatingSystemRecipe.distribution);
String version = operatingSystemRecipe.version;
if (Strings.isNullOrEmpty(version)) {
version = distribution.getDefaultOsVersion();
}
return new OperatingSystem(distribution, version);
}
Aggregations