ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rle...@apache.org
Subject ambari git commit: AMBARI-10930. After disable Kerberos and change Realm, test principal with old realm is created when re-enabling Kerberos (Emil Anca via rlevas)
Date Wed, 06 May 2015 01:43:14 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk da9ab2821 -> a2390c699


AMBARI-10930. After disable Kerberos and change Realm, test principal with old realm is created
when re-enabling Kerberos (Emil Anca via rlevas)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a2390c69
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a2390c69
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a2390c69

Branch: refs/heads/trunk
Commit: a2390c699c94abcc80233cd6cd2d7139cbbc8ffd
Parents: da9ab28
Author: Emil Anca <eanca@hortonworks.com>
Authored: Tue May 5 21:43:26 2015 -0400
Committer: Robert Levas <rlevas@hortonworks.com>
Committed: Tue May 5 21:43:31 2015 -0400

----------------------------------------------------------------------
 .../server/controller/KerberosHelper.java       | 34 ++++++++++++++++++--
 .../server/controller/KerberosHelperTest.java   |  8 ++++-
 2 files changed, 39 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a2390c69/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
index 1c4365c..6b970c6 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelper.java
@@ -67,6 +67,7 @@ import org.apache.ambari.server.serveraction.kerberos.KerberosOperationHandlerFa
 import org.apache.ambari.server.serveraction.kerberos.KerberosRealmException;
 import org.apache.ambari.server.serveraction.kerberos.KerberosServerAction;
 import org.apache.ambari.server.serveraction.kerberos.UpdateKerberosConfigsServerAction;
+import org.apache.ambari.server.serveraction.kerberos.CleanupServerAction;
 import org.apache.ambari.server.stageplanner.RoleGraph;
 import org.apache.ambari.server.stageplanner.RoleGraphFactory;
 import org.apache.ambari.server.state.Cluster;
@@ -911,7 +912,7 @@ public class KerberosHelper {
             hostParamsJson, event, roleCommandOrder, kerberosDetails, dataDirectory,
             requestStageContainer, serviceComponentHostsToProcess, hostsWithValidKerberosClient);
 
-        // Add the cleanup stage...
+        // Add the finalize stage...
         handler.addFinalizeOperationStage(cluster, clusterHostInfoJson, hostParamsJson, event,
             dataDirectory, roleCommandOrder, requestStageContainer);
 
@@ -2450,7 +2451,7 @@ public class KerberosHelper {
                                           RoleCommandOrder roleCommandOrder, RequestStageContainer
requestStageContainer)
         throws AmbariException {
 
-      // Add the cleanup stage...
+      // Add the finalize stage...
       Map<String, String> commandParameters = new HashMap<String, String>();
       commandParameters.put(KerberosServerAction.AUTHENTICATED_USER_NAME, ambariManagementController.getAuthName());
       commandParameters.put(KerberosServerAction.DATA_DIRECTORY, dataDirectory.getAbsolutePath());
@@ -2471,6 +2472,31 @@ public class KerberosHelper {
       roleGraph.build(stage);
       requestStageContainer.addStages(roleGraph.getStages());
     }
+
+    public void addCleanupStage(Cluster cluster, String clusterHostInfoJson,
+                                String hostParamsJson, ServiceComponentHostServerActionEvent
event,
+                                Map<String, String> commandParameters,
+                                RoleCommandOrder roleCommandOrder, RequestStageContainer
requestStageContainer)
+      throws AmbariException {
+      Stage stage = createServerActionStage(requestStageContainer.getLastStageId(),
+        cluster,
+        requestStageContainer.getId(),
+        "Kerberization Clean Up",
+        clusterHostInfoJson,
+        "{}",
+        hostParamsJson,
+        CleanupServerAction.class,
+        event,
+        commandParameters,
+        "Kerberization Clean Up",
+        1200);
+
+      RoleGraph roleGraph = roleGraphFactory.createNew(roleCommandOrder);
+      roleGraph.build(stage);
+      requestStageContainer.addStages(roleGraph.getStages());
+    }
+
+
   }
 
   /**
@@ -2798,6 +2824,10 @@ public class KerberosHelper {
         // Create stage to delete keytabs
         addDeleteKeytabFilesStage(cluster, serviceComponentHosts, clusterHostInfoJson,
             hostParamsJson, commandParameters, roleCommandOrder, requestStageContainer, hostsWithValidKerberosClient);
+        // *****************************************************************
+        // Create stage to perform data cleanups (e.g. kerberos descriptor artifact database
leftovers)
+        addCleanupStage(cluster, clusterHostInfoJson, hostParamsJson, event, commandParameters,
+          roleCommandOrder, requestStageContainer);
       }
 
       return requestStageContainer.getLastStageId();

http://git-wip-us.apache.org/repos/asf/ambari/blob/a2390c69/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
index 9bc9b9f..54170a6 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/KerberosHelperTest.java
@@ -1425,7 +1425,13 @@ public class KerberosHelperTest extends EasyMockSupport {
     expect(requestStageContainer.getId()).andReturn(1L).once();
     requestStageContainer.addStages(anyObject(List.class));
     expectLastCall().once();
-    // Clean-up/Finalize Stage
+    // Finalize Stage
+    expect(requestStageContainer.getLastStageId()).andReturn(3L).anyTimes();
+    expect(requestStageContainer.getId()).andReturn(1L).once();
+    requestStageContainer.addStages(anyObject(List.class));
+    expectLastCall().once();
+
+    // Cleanup Stage
     expect(requestStageContainer.getLastStageId()).andReturn(3L).anyTimes();
     expect(requestStageContainer.getId()).andReturn(1L).once();
     requestStageContainer.addStages(anyObject(List.class));


Mime
View raw message