Browse Source

AMBARI-323.During any process in the cluster initialization wizard, if the user goes back to the 1 Create Cluster tab, the user is stuck. (Contributed by Vikram)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1345405 13f79535-47bb-0310-9956-ffa450edef68
Vikram Dixit K 13 years ago
parent
commit
8f9e0141ab
2 changed files with 10 additions and 4 deletions
  1. 2 0
      CHANGES.txt
  2. 8 4
      hmc/php/frontend/createCluster.php

+ 2 - 0
CHANGES.txt

@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-323. During any process in the cluster initialization wizard, if the user goes back to the "1 Create Cluster" tab, the user is stuck. (Vikram)
+
   AMBARI-319. Scale puppet master to large number of nodes. (Jitendra via Vikram)
 
   AMBARI-318. Do not install the packages that install init.d scripts (Ramya via Vikram).

+ 8 - 4
hmc/php/frontend/createCluster.php

@@ -18,10 +18,6 @@ if ($allClustersResult["result"] != 0) {
   print(json_encode($allClustersResult));
   return;
 }
-if (!$multipleClustersSupported && count($allClustersResult["clusters"]) != 0 ) {
-  print (json_encode(array( "result" => 1, "error" => "Multiple clusters are not supported and you already have a cluster installed" )));
-  return;
-}
 
 // Read from the input
 $requestdata = file_get_contents('php://input');
@@ -45,6 +41,14 @@ if (preg_match('/(\?|\+|\-|\||\"|\[|\]|\/|\{|\}|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\'
 }
 // Validate clusterName: TODO; FIXME
 
+if (!array_key_exists($clusterName, $allClustersResult["clusters"])) {
+  if (!$multipleClustersSupported && count($allClustersResult["clusters"]) != 0 ) {
+    print (json_encode(array( "result" => 1, "error" => "Multiple clusters are not supported and you already have a cluster installed" )));
+    return;
+  }
+}
+
+
 // create the lockfile in the clusterDir
 $fileHdl = fopen($GLOBALS["HMC_CLUSTER_PATH"]."/lockfile", "w");
 if ($fileHdl == false) {