void fixLivySuperusers() throws AmbariException {
    Clusters clusters = injector.getInstance(Clusters.class);
    if (clusters != null) {
      Map<String, Cluster> clusterMap = clusters.getClusters();

      if (clusterMap != null && !clusterMap.isEmpty()) {
        for (final Cluster cluster : clusterMap.values()) {
          Config zeppelinEnvProperties = cluster.getDesiredConfigByType("zeppelin-env");
          if (zeppelinEnvProperties != null) {
            Map<String, String> zeppelinProperties = zeppelinEnvProperties.getProperties();
            if (zeppelinProperties != null) {
              String zeppelinPrincipal = zeppelinProperties.get("zeppelin.server.kerberos.principal");

              if (!StringUtils.isEmpty(zeppelinPrincipal)) {
                // Parse the principal name component from the full principal. The default realm of
                // EXAMPLE.COM is used because we really don't care what the realm is.
                DeconstructedPrincipal deconstructedPrincipal = DeconstructedPrincipal.valueOf(zeppelinPrincipal, "EXAMPLE.COM");
                String newZeppelinPrincipalName = deconstructedPrincipal.getPrincipalName();
                String oldZeppelinPrincipalName = "zeppelin-" + cluster.getClusterName().toLowerCase();

                // Fix livy-conf/livy.supserusers
                updateListValues(cluster, "livy-conf", "livy.superusers",
                    Collections.singleton(newZeppelinPrincipalName), Collections.singleton(oldZeppelinPrincipalName));

                // Fix livy2-conf/livy.supserusers
                updateListValues(cluster, "livy2-conf", "livy.superusers",
                    Collections.singleton(newZeppelinPrincipalName), Collections.singleton(oldZeppelinPrincipalName));
              }
            }
          }
        }
      }
    }
  }
Fixes the <code>livy.superusers</code> value in <code>livy-conf</code> and
<code>livy2-conf</code>.
<p>
When Kerberos is enabled, the values of <code>livy.superusers</code> in <code>livy-conf</code>
and <code>livy2-conf</code> are potentially incorrect due to an issue with the Spark and Spark2
kerberos.json files.  In Ambari 2.5.2, the logic to set <code>livy.superusers</code> has been
moved to the stack advisor and removed from the kerberos.json files.  The user-supplied Kerberos
descriptor is fixed in {@link #updateKerberosDescriptorArtifact(ArtifactDAO, ArtifactEntity)}.
<p>
If Zeppelin is installed and Kerberos is enabled, then <code>livy.superusers</code> should be
updated to contain the proper value for the Zeppelin user. If the incorrect value is there and
in the form of <code>zeppelin-clustername</code> then it will be removed.
ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog252.java