Browse Source

Ambari 23644 Handle back end issues related to new Service Config API

mradha25 7 years ago
parent
commit
9308a86937

+ 3 - 0
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java

@@ -6015,6 +6015,9 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle
         }
       }
 
+      m_metadataHolder.get().updateData(getClusterMetadataOnConfigsUpdate(cluster));
+      m_agentConfigsHolder.get().updateData(cluster.getClusterId(), null);
+
       if (request.getVersion() != null) {
         if (!AuthorizationHelper.isAuthorized(ResourceType.CLUSTER, cluster.getResourceId(), EnumSet.of(RoleAuthorization.SERVICE_MODIFY_CONFIGS))) {
           throw new AuthorizationException("The authenticated user does not have authorization to modify service configurations");

+ 2 - 1
ambari-server/src/main/java/org/apache/ambari/server/mpack/MpackManager.java

@@ -217,6 +217,7 @@ public class MpackManager {
       mpackTarPath = downloadMpack(mpackRequest.getMpackUri(), mpack.getDefinition());
 
       LOG.info("Custom Mpack Registration :" + mpackRequest.getMpackUri());
+      createMpackDirectory(mpack);
       mpackDirectory = mpacksStaging + File.separator + mpack.getName() + File.separator + mpack.getVersion();
     }
 
@@ -319,7 +320,7 @@ public class MpackManager {
    */
   private void extractMpackTar(Mpack mpack, Path mpackTarPath, String mpackDirectory) throws IOException {
 
-    if(!Files.exists(mpackTarPath)) {
+    if(!Files.exists(Paths.get(mpackDirectory))) {
       extractTar(mpackTarPath, mpacksStaging);
 
       String mpackTarDirectory = mpackTarPath.toString();