Search in sources :

Example 1 with CommandDetails

use of com.sequenceiq.cloudbreak.cm.exception.CommandDetails in project cloudbreak by hortonworks.

the class ClouderaManagerTemplateInstallationChecker method fail.

private void fail(String messagePrefix, ApiCommand apiCommand, CommandsResourceApi commandsResourceApi, StackType stackType) {
    List<CommandDetails> failedCommands = ClouderaManagerCommandUtil.getFailedOrActiveCommands(apiCommand, commandsResourceApi);
    String msg = messagePrefix + "Installation of CDP with Cloudera Manager has failed. " + CommandDetailsFormatter.formatFailedCommands(failedCommands);
    LOGGER.debug("Top level command {}. Failed or active commands: {}", CommandDetails.fromApiCommand(apiCommand), failedCommands);
    if (stackType == StackType.DATALAKE) {
        for (CommandDetails failedCommand : failedCommands) {
            // has no added value, therefore we are just checking whether AuditDir related commands are failing or not.
            if (CLOUD_STORAGE_RELATED_COMMANDS.contains(failedCommand.getName()) && CommandDetails.CommandStatus.FAILED == failedCommand.getCommandStatus()) {
                throw new CloudStorageConfigurationFailedException(msg);
            }
        }
    }
    throw new ClouderaManagerOperationFailedException(msg);
}
Also used : ClouderaManagerOperationFailedException(com.sequenceiq.cloudbreak.cm.ClouderaManagerOperationFailedException) CommandDetails(com.sequenceiq.cloudbreak.cm.exception.CommandDetails) CloudStorageConfigurationFailedException(com.sequenceiq.cloudbreak.cm.exception.CloudStorageConfigurationFailedException)

Aggregations

ClouderaManagerOperationFailedException (com.sequenceiq.cloudbreak.cm.ClouderaManagerOperationFailedException)1 CloudStorageConfigurationFailedException (com.sequenceiq.cloudbreak.cm.exception.CloudStorageConfigurationFailedException)1 CommandDetails (com.sequenceiq.cloudbreak.cm.exception.CommandDetails)1