You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vi...@apache.org on 2012/06/07 01:26:10 UTC

svn commit: r1347210 - in /incubator/ambari/branches/ambari-186: CHANGES.txt hmc/php/frontend/addNodes.php hmc/php/frontend/createCluster.php

Author: vikram
Date: Wed Jun  6 23:26:09 2012
New Revision: 1347210

URL: http://svn.apache.org/viewvc?rev=1347210&view=rev
Log:
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)

Modified:
    incubator/ambari/branches/ambari-186/CHANGES.txt
    incubator/ambari/branches/ambari-186/hmc/php/frontend/addNodes.php
    incubator/ambari/branches/ambari-186/hmc/php/frontend/createCluster.php

Modified: incubator/ambari/branches/ambari-186/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/CHANGES.txt?rev=1347210&r1=1347209&r2=1347210&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/CHANGES.txt (original)
+++ incubator/ambari/branches/ambari-186/CHANGES.txt Wed Jun  6 23:26:09 2012
@@ -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)

Modified: incubator/ambari/branches/ambari-186/hmc/php/frontend/addNodes.php
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/php/frontend/addNodes.php?rev=1347210&r1=1347209&r2=1347210&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/php/frontend/addNodes.php (original)
+++ incubator/ambari/branches/ambari-186/hmc/php/frontend/addNodes.php Wed Jun  6 23:26:09 2012
@@ -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);
 

Modified: incubator/ambari/branches/ambari-186/hmc/php/frontend/createCluster.php
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/php/frontend/createCluster.php?rev=1347210&r1=1347209&r2=1347210&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/php/frontend/createCluster.php (original)
+++ incubator/ambari/branches/ambari-186/hmc/php/frontend/createCluster.php Wed Jun  6 23:26:09 2012
@@ -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"));