@Override
  public boolean removePrincipal(String principal, boolean service) throws KerberosOperationException {
    if (!isOpen()) {
      throw new KerberosOperationException("This operation handler has not been opened");
    }

    if (StringUtils.isEmpty(principal)) {
      throw new KerberosOperationException("Failed to remove principal - no principal specified");
    }

    DeconstructedPrincipal deconstructedPrincipal = createDeconstructPrincipal(principal);

    String[] ipaCommand = (service)
        ? new String[]{"service-del", deconstructedPrincipal.getNormalizedPrincipal()}
        : new String[]{"user-del", deconstructedPrincipal.getPrincipalName()};

    return invokeIpa(ipaCommand).isSuccessful();
  }
Removes an existing principal in a previously configured KDC
<p/>
The implementation is specific to a particular type of KDC.

@param principal a String containing the principal to remove
@param service   a boolean value indicating whether the principal is for a service or not
@return true if the principal was successfully removed; otherwise false
@throws KerberosKDCConnectionException       if a connection to the KDC cannot be made
@throws KerberosAdminAuthenticationException if the administrator credentials fail to authenticate
@throws KerberosRealmException               if the realm does not map to a KDC
@throws KerberosOperationException           if an unexpected error occurred
ambari-server/src/main/java/org/apache/ambari/server/serveraction/kerberos/IPAKerberosOperationHandler.java