Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 f08628e7c -> 4a4397d20


AMBARI-19388 PERF: disabling security fails (dsen)


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

Branch: refs/heads/branch-2.5
Commit: 4a4397d2058b9c8f1ca1d545030e9264b33b570d
Parents: f08628e
Author: Dmytro Sen <[email protected]>
Authored: Fri Jan 6 19:26:40 2017 +0200
Committer: Dmytro Sen <[email protected]>
Committed: Fri Jan 6 19:27:52 2017 +0200

----------------------------------------------------------------------
 .../controller/AmbariCustomCommandExecutionHelper.java       | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4a4397d2/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 0cf46df..bdad015 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
@@ -324,6 +324,9 @@ public class AmbariCustomCommandExecutionHelper {
     StackInfo stackInfo = ambariMetaInfo.getStack
        (stackId.getStackName(), stackId.getStackVersion());
 
+    ClusterVersionEntity effectiveClusterVersion = 
cluster.getEffectiveClusterVersion();
+    boolean isUpgradeSuspended = cluster.isUpgradeSuspended();
+
     CustomCommandDefinition customCommandDefinition = null;
     ComponentInfo ci = serviceInfo.getComponentByName(componentName);
     if(ci != null){
@@ -390,7 +393,7 @@ public class AmbariCustomCommandExecutionHelper {
       hostLevelParams.put(STACK_VERSION, stackId.getStackVersion());
 
       Map<String, DesiredConfig> desiredConfigs = cluster.getDesiredConfigs();
-      
+
       Set<String> userSet = 
configHelper.getPropertyValuesWithPropertyType(stackId, PropertyType.USER, 
cluster, desiredConfigs);
       String userList = gson.toJson(userSet);
       hostLevelParams.put(USER_LIST, userList);
@@ -442,7 +445,6 @@ public class AmbariCustomCommandExecutionHelper {
       commandParams.put(SERVICE_PACKAGE_FOLDER, 
serviceInfo.getServicePackageFolder());
       commandParams.put(HOOKS_FOLDER, stackInfo.getStackHooksFolder());
 
-      ClusterVersionEntity effectiveClusterVersion = 
cluster.getEffectiveClusterVersion();
       if (effectiveClusterVersion != null) {
        commandParams.put(KeyNames.VERSION, 
effectiveClusterVersion.getRepositoryVersion().getVersion());
       }
@@ -456,7 +458,7 @@ public class AmbariCustomCommandExecutionHelper {
 
       // if there is a stack upgrade which is currently suspended then pass 
that
       // information down with the command as some components may need to know
-      if (cluster.isUpgradeSuspended()) {
+      if (isUpgradeSuspended) {
         roleParams.put(KeyNames.UPGRADE_SUSPENDED, 
Boolean.TRUE.toString().toLowerCase());
       }
 

Reply via email to