ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smn...@apache.org
Subject ambari git commit: AMBARI-19751: Credential Store params should be in the command json for RESTART
Date Fri, 27 Jan 2017 20:42:06 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 65eb88672 -> 9d8a54c23


AMBARI-19751: Credential Store params should be in the command json for RESTART


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

Branch: refs/heads/trunk
Commit: 9d8a54c23146db595e81d72785c4f9779f3bee00
Parents: 65eb886
Author: Nahappan Somasundaram <nsomasundaram@hortonworks.com>
Authored: Fri Jan 27 09:56:03 2017 -0800
Committer: Nahappan Somasundaram <nsomasundaram@hortonworks.com>
Committed: Fri Jan 27 12:32:59 2017 -0800

----------------------------------------------------------------------
 .../AmbariCustomCommandExecutionHelper.java         | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9d8a54c2/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
index 8b851ac..93f4a8f 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
@@ -175,6 +175,8 @@ public class AmbariCustomCommandExecutionHelper {
   @Inject
   private HostRoleCommandDAO hostRoleCommandDAO;
 
+  private Map<String, Map<String, Map<String, String>>> configCredentialsForService
= new HashMap<>();
+
   protected static final String SERVICE_CHECK_COMMAND_NAME = "SERVICE_CHECK";
   protected static final String START_COMMAND_NAME = "START";
   protected static final String RESTART_COMMAND_NAME = "RESTART";
@@ -382,6 +384,20 @@ public class AmbariCustomCommandExecutionHelper {
 
       execCmd.setAvailableServicesFromServiceInfoMap(ambariMetaInfo.getServices(stackId.getStackName(),
stackId.getStackVersion()));
 
+      // Get the value of credential store enabled from the DB
+      Service clusterService = cluster.getService(serviceName);
+      execCmd.setCredentialStoreEnabled(String.valueOf(clusterService.isCredentialStoreEnabled()));
+
+      // Get the map of service config type to password properties for the service
+      Map<String, Map<String, String>> configCredentials;
+      configCredentials = configCredentialsForService.get(clusterService.getName());
+      if (configCredentials == null) {
+        configCredentials = configHelper.getCredentialStoreEnabledProperties(stackId, clusterService);
+        configCredentialsForService.put(clusterService.getName(), configCredentials);
+      }
+
+      execCmd.setConfigurationCredentials(configCredentials);
+
       Map<String, String> hostLevelParams = new TreeMap<>();
 
       hostLevelParams.put(CUSTOM_COMMAND, commandName);


Mime
View raw message