ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vbrodets...@apache.org
Subject ambari git commit: AMBARI-11827. Download Client Configs function results in an exception and error 500.(Shantanu Mundkur via vbrodetskyi)
Date Wed, 24 Jun 2015 20:44:31 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 10f7f42c7 -> 81a55a541


AMBARI-11827. Download Client Configs function results in an exception and error 500.(Shantanu
Mundkur via vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: 81a55a541a5be38773f126f7e39b2516e9b81412
Parents: 10f7f42
Author: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Authored: Wed Jun 24 23:43:43 2015 +0300
Committer: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Committed: Wed Jun 24 23:43:43 2015 +0300

----------------------------------------------------------------------
 .../controller/internal/ClientConfigResourceProvider.java   | 9 ++-------
 .../internal/ClientConfigResourceProviderTest.java          | 6 +++---
 2 files changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/81a55a54/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
index c42814f..dea0362 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java
@@ -199,13 +199,8 @@ public class ClientConfigResourceProvider extends AbstractControllerResourceProv
         throw new SystemException("No configuration files defined for the component " + componentInfo.getName());
       }
 
-      String stackRoot = managementController.getAmbariMetaInfo().getStackRoot().getAbsolutePath();
-      String packageFolderAbsolute = null;
-      if (packageFolder.contains(StackManager.COMMON_SERVICES)){
-        packageFolderAbsolute = configs.getCommonServicesPath().replace(StackManager.COMMON_SERVICES,
packageFolder);
-      } else {
-        packageFolderAbsolute = stackRoot + File.separator + packageFolder;
-      }
+      String resourceDirPath = configs.getResourceDirPath();
+      String packageFolderAbsolute = resourceDirPath + File.separator + packageFolder;
       
       String commandScriptAbsolute = packageFolderAbsolute + File.separator + commandScript;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/81a55a54/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
index 9d78245..d5808d3 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProviderTest.java
@@ -236,6 +236,7 @@ public class ClientConfigResourceProviderTest {
     expect(configMap.get(Configuration.SERVER_TMP_DIR_KEY)).andReturn(Configuration.SERVER_TMP_DIR_DEFAULT);
     expect(configMap.get(Configuration.AMBARI_PYTHON_WRAP_KEY)).andReturn(Configuration.AMBARI_PYTHON_WRAP_DEFAULT);
     expect(configuration.getConfigsMap()).andReturn(returnConfigMap);
+    expect(configuration.getResourceDirPath()).andReturn("/tmp/stacks/S1/V1");
     expect(configuration.getJavaVersion()).andReturn(8);
     expect(configuration.areHostsSysPrepped()).andReturn("false");
     expect(configuration.getExternalScriptTimeout()).andReturn(Integer.parseInt(Configuration.EXTERNAL_SCRIPT_TIMEOUT_DEFAULT));
@@ -277,7 +278,6 @@ public class ClientConfigResourceProviderTest {
             (String) anyObject(), (String) anyObject())).andReturn(componentInfo).anyTimes();
     expect(componentInfo.getCommandScript()).andReturn(commandScriptDefinition);
     expect(componentInfo.getClientConfigFiles()).andReturn(clientConfigFileDefinitionList);
-    expect(ambariMetaInfo.getStackRoot()).andReturn(stackRootFile);
     expect(cluster.getConfig("hive-site", null)).andReturn(clusterConfig);
     expect(cluster.getDesiredConfigs()).andReturn(desiredConfigMap);
     expect(clusters.getHost(hostName)).andReturn(host);
@@ -437,10 +437,11 @@ public class ClientConfigResourceProviderTest {
     expect(configMap.get(Configuration.SERVER_TMP_DIR_KEY)).andReturn(Configuration.SERVER_TMP_DIR_DEFAULT);
     expect(configMap.get(Configuration.AMBARI_PYTHON_WRAP_KEY)).andReturn(Configuration.AMBARI_PYTHON_WRAP_DEFAULT);
     expect(configuration.getConfigsMap()).andReturn(returnConfigMap);
-    expect(configuration.getCommonServicesPath()).andReturn(commonServicesPath);
+    expect(configuration.getResourceDirPath()).andReturn("/var/lib/ambari-server/src/main/resources");
     expect(configuration.getJavaVersion()).andReturn(8);
     expect(configuration.areHostsSysPrepped()).andReturn("false");
     expect(configuration.getExternalScriptTimeout()).andReturn(Integer.parseInt(Configuration.EXTERNAL_SCRIPT_TIMEOUT_DEFAULT));
+
     Map<String,String> props = new HashMap<String, String>();
     props.put(Configuration.HIVE_METASTORE_PASSWORD_PROPERTY, "pass");
     props.put("key","value");
@@ -479,7 +480,6 @@ public class ClientConfigResourceProviderTest {
             (String) anyObject(), (String) anyObject())).andReturn(componentInfo).anyTimes();
     expect(componentInfo.getCommandScript()).andReturn(commandScriptDefinition);
     expect(componentInfo.getClientConfigFiles()).andReturn(clientConfigFileDefinitionList);
-    expect(ambariMetaInfo.getStackRoot()).andReturn(stackRootFile);
     expect(cluster.getConfig("hive-site", null)).andReturn(clusterConfig);
     expect(cluster.getDesiredConfigs()).andReturn(desiredConfigMap);
     expect(clusters.getHost(hostName)).andReturn(host);


Mime
View raw message