private Map<String, Object> buildStackDescriptor(String stackName, String stackVersion)
      throws NoSuchParentResourceException, IOException {

    KerberosDescriptor kerberosDescriptor = new KerberosDescriptor();

    AmbariManagementController controller = getManagementController();
    StackInfo stackInfo;
    try {
      stackInfo = controller.getAmbariMetaInfo().getStack(stackName, stackVersion);
    } catch (StackAccessException e) {
      throw new NoSuchParentResourceException(String.format(
          "Parent stack resource doesn't exist: stackName='%s', stackVersion='%s'", stackName, stackVersion));
    }

    Collection<KerberosServiceDescriptor> serviceDescriptors = getServiceDescriptors(stackInfo);

    serviceDescriptors.forEach(kerberosDescriptor::putService);
    return kerberosDescriptor.toMap();
  }
Build a kerberos descriptor for the specified stack. This descriptor is for the entire stack version
and will contain both the stack descriptor as well as all service descriptors.

@return map of kerberos descriptor data or null if no descriptor exists

@throws IOException     if unable to read the kerberos descriptor file
@throws AmbariException if unable to parse the kerberos descriptor file json
@throws NoSuchParentResourceException if the parent stack doesn't exist
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackArtifactResourceProvider.java