Search in sources :

Example 11 with CloudbreakImageNotFoundException

use of com.sequenceiq.cloudbreak.core.CloudbreakImageNotFoundException in project cloudbreak by hortonworks.

the class StackToStackDetailsConverter method convertComponents.

private void convertComponents(StackDetails stackDetails, Stack stack) {
    Long stackId = stack.getId();
    CloudbreakDetails cloudbreakDetails = componentConfigProvider.getCloudbreakDetails(stackId);
    if (cloudbreakDetails != null) {
        stackDetails.setCloudbreakVersion(cloudbreakDetails.getVersion());
    }
    try {
        Image image = componentConfigProvider.getImage(stackId);
        stackDetails.setImageIdentifier(image.getImageName());
    } catch (CloudbreakImageNotFoundException e) {
        LOGGER.warn("Image not found! {}", e.getMessage());
    }
    AmbariRepo ambariRepo = componentConfigProvider.getAmbariRepo(stackId);
    if (ambariRepo != null) {
        stackDetails.setPrewarmedImage(ambariRepo.getPredefined());
        stackDetails.setAmbariVersion(ambariRepo.getVersion());
    } else {
        stackDetails.setPrewarmedImage(Boolean.FALSE);
    }
    StackRepoDetails stackRepoDetails = componentConfigProvider.getHDPRepo(stackId);
    if (stackRepoDetails != null) {
        stackDetails.setClusterType(stackRepoDetails.getStack().get(StackRepoDetails.REPO_ID_TAG));
        stackDetails.setClusterVersion(stackRepoDetails.getHdpVersion());
    }
}
Also used : StackRepoDetails(com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails) CloudbreakDetails(com.sequenceiq.cloudbreak.cloud.model.CloudbreakDetails) CloudbreakImageNotFoundException(com.sequenceiq.cloudbreak.core.CloudbreakImageNotFoundException) AmbariRepo(com.sequenceiq.cloudbreak.cloud.model.AmbariRepo) Image(com.sequenceiq.cloudbreak.cloud.model.Image)

Aggregations

CloudbreakImageNotFoundException (com.sequenceiq.cloudbreak.core.CloudbreakImageNotFoundException)11 Image (com.sequenceiq.cloudbreak.cloud.model.Image)7 CloudStack (com.sequenceiq.cloudbreak.cloud.model.CloudStack)2 Stack (com.sequenceiq.cloudbreak.domain.Stack)2 CloudbreakServiceException (com.sequenceiq.cloudbreak.service.CloudbreakServiceException)2 ClusterResponse (com.sequenceiq.cloudbreak.api.model.ClusterResponse)1 CredentialResponse (com.sequenceiq.cloudbreak.api.model.CredentialResponse)1 FailurePolicyResponse (com.sequenceiq.cloudbreak.api.model.FailurePolicyResponse)1 ImageJson (com.sequenceiq.cloudbreak.api.model.ImageJson)1 InstanceGroupResponse (com.sequenceiq.cloudbreak.api.model.InstanceGroupResponse)1 NetworkResponse (com.sequenceiq.cloudbreak.api.model.NetworkResponse)1 OrchestratorResponse (com.sequenceiq.cloudbreak.api.model.OrchestratorResponse)1 StackAuthenticationResponse (com.sequenceiq.cloudbreak.api.model.StackAuthenticationResponse)1 StackResponse (com.sequenceiq.cloudbreak.api.model.StackResponse)1 ImageSettings (com.sequenceiq.cloudbreak.api.model.v2.ImageSettings)1 CheckImageRequest (com.sequenceiq.cloudbreak.cloud.event.setup.CheckImageRequest)1 CheckImageResult (com.sequenceiq.cloudbreak.cloud.event.setup.CheckImageResult)1 PrepareImageRequest (com.sequenceiq.cloudbreak.cloud.event.setup.PrepareImageRequest)1 SetupResult (com.sequenceiq.cloudbreak.cloud.event.setup.SetupResult)1 AmbariRepo (com.sequenceiq.cloudbreak.cloud.model.AmbariRepo)1