Search in sources :

Example 1 with Distribution

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);
}
Also used : OperatingSystem(org.platformlayer.service.imagefactory.OperatingSystem) Distribution(org.platformlayer.service.imagefactory.OperatingSystem.Distribution) OperatingSystemRecipe(org.platformlayer.images.model.OperatingSystemRecipe)

Aggregations

OperatingSystemRecipe (org.platformlayer.images.model.OperatingSystemRecipe)1 OperatingSystem (org.platformlayer.service.imagefactory.OperatingSystem)1 Distribution (org.platformlayer.service.imagefactory.OperatingSystem.Distribution)1