소스 검색

AMBARI-410. Need to move the creation of cluster directory for hosting the key file and the nodes file to add nodes. (Contributed by Vikram)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1347210 13f79535-47bb-0310-9956-ffa450edef68
Vikram Dixit K 13 년 전
부모
커밋
4a747a430d
3개의 변경된 파일11개의 추가작업 그리고 7개의 파일을 삭제
  1. 2 0
      CHANGES.txt
  2. 9 0
      hmc/php/frontend/addNodes.php
  3. 0 7
      hmc/php/frontend/createCluster.php

+ 2 - 0
CHANGES.txt

@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-410. Need to move the creation of cluster directory for hosting the key file and the nodes file to add nodes. (Vikram)
+
   AMBARI-408. HDPJobTracker cluster in ganglia has multiple nodes (Suhas via Vikram)
 
   AMBARI-426. Reinstall of cluster after failure to install results in failure (Ramya via Vikram)

+ 9 - 0
hmc/php/frontend/addNodes.php

@@ -44,6 +44,15 @@ if ($freshInstall) {
 // Read from the input
 $deployUser = $_POST['ClusterDeployUser'];
 
+/////// Remove the cluster directory before copying the files
+$clusterDir = getClusterDir($clusterName);
+rrmdir($clusterDir);
+if (!is_dir($clusterDir) && !mkdir($clusterDir, 0700, true)) {
+  print json_encode(array( "result" => 1, "error" => 'Failed to create directory...'));
+  return;
+}
+////// end of directory removal
+
 $identityFileDestination = getSshKeyFilePath($clusterName);
 $hostsFileDestination = getHostsFilePath($clusterName);
 

+ 0 - 7
hmc/php/frontend/createCluster.php

@@ -122,13 +122,6 @@ if ($result["result"] != 0 ) {
 }
 // end of populating the ServiceComponentInfo table
 
-$clusterDir = getClusterDir($clusterName);
-rrmdir($clusterDir);
-if (!is_dir($clusterDir) && !mkdir($clusterDir, 0700, true)) {
-  print json_encode(array( "result" => 1, "error" => 'Failed to create directory...'));
-  return;
-}
-
 $propertiesArr = $dbAccessor->getConfigPropertiesMetaInfo();
 if ($propertiesArr["result"] != 0) {
   print json_encode(array( "result" => 1, "error" => "Error in config properties meta info"));