You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ra...@apache.org on 2012/05/17 19:46:41 UTC

svn commit: r1339740 - in /incubator/ambari/branches/ambari-186: CHANGES.txt hmc/php/orchestrator/Cluster.php hmc/php/puppet/PuppetInvoker.php hmc/php/puppet/genmanifest/hostsConfig.php

Author: ramya
Date: Thu May 17 17:46:40 2012
New Revision: 1339740

URL: http://svn.apache.org/viewvc?rev=1339740&view=rev
Log:
AMBARI-245. Support data cleanup if installation fails

Modified:
    incubator/ambari/branches/ambari-186/CHANGES.txt
    incubator/ambari/branches/ambari-186/hmc/php/orchestrator/Cluster.php
    incubator/ambari/branches/ambari-186/hmc/php/puppet/PuppetInvoker.php
    incubator/ambari/branches/ambari-186/hmc/php/puppet/genmanifest/hostsConfig.php

Modified: incubator/ambari/branches/ambari-186/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/CHANGES.txt?rev=1339740&r1=1339739&r2=1339740&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/CHANGES.txt (original)
+++ incubator/ambari/branches/ambari-186/CHANGES.txt Thu May 17 17:46:40 2012
@@ -2,6 +2,8 @@ Ambari Change log
 
 Release 0.x.x - unreleased
 
+  AMBARI-245. Support data cleanup if installation fails (Jitendra via ramya)
+
   AMBARI-248. Add yuiCombinator.php to rpm (Jitendra via ramya)
 
   AMBARI-297. Modal dialog box for showing deploy progress looks broken

Modified: incubator/ambari/branches/ambari-186/hmc/php/orchestrator/Cluster.php
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/php/orchestrator/Cluster.php?rev=1339740&r1=1339739&r2=1339740&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/php/orchestrator/Cluster.php (original)
+++ incubator/ambari/branches/ambari-186/hmc/php/orchestrator/Cluster.php Thu May 17 17:46:40 2012
@@ -118,7 +118,7 @@ class Cluster {
       }
       $nodes = $result["nodes"];
       $result = $this->puppet->kickPuppet($nodes, $transaction, $this->name,
-          $result["componentMapping"], array ("wipeoutData" => $wipeoutData));
+          $result["componentMapping"], array ("wipeoff_data" => $wipeoutData));
       $this->logger->log_debug("Puppet kick response for uninstalling "
           . "cluster=" . $this->name
           . ", txn=" . $transaction->toString()

Modified: incubator/ambari/branches/ambari-186/hmc/php/puppet/PuppetInvoker.php
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/php/puppet/PuppetInvoker.php?rev=1339740&r1=1339739&r2=1339740&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/php/puppet/PuppetInvoker.php (original)
+++ incubator/ambari/branches/ambari-186/hmc/php/puppet/PuppetInvoker.php Thu May 17 17:46:40 2012
@@ -102,7 +102,8 @@
        return array($hostInfo, $configInfo, $hostRolesStates, $hostAttributes);
     }
 
-    public function kickPuppet($nodes, $txnObj, $clusterName, $nodesComponents) {
+    public function kickPuppet($nodes, $txnObj, $clusterName, $nodesComponents,
+        $globalOptions) {
       //Get host config from db
       $txnId = $txnObj->toString();
       $components = array_keys($nodesComponents);
@@ -111,6 +112,14 @@
       $configInfo = $infoFromDb[1];
       $hostRolesStates = $infoFromDb[2];
       $hostAttributes = $infoFromDb[3];
+
+      //Treat globalOpts as configs only
+      if (!empty($globalOptions)) {
+        foreach ($globalOptions as $key => $value) {
+          $configInfo[$key] = $value;
+        }
+      }
+       
       $response = $this->genKickWait($nodes, $txnId, $clusterName, $hostInfo,
           $configInfo, $hostRolesStates, $hostAttributes, $GLOBALS["puppetManifestDir"],
           $GLOBALS["puppetKickVersionFile"], $GLOBALS["DRYRUN"]);

Modified: incubator/ambari/branches/ambari-186/hmc/php/puppet/genmanifest/hostsConfig.php
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/php/puppet/genmanifest/hostsConfig.php?rev=1339740&r1=1339739&r2=1339740&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/php/puppet/genmanifest/hostsConfig.php (original)
+++ incubator/ambari/branches/ambari-186/hmc/php/puppet/genmanifest/hostsConfig.php Thu May 17 17:46:40 2012
@@ -75,7 +75,8 @@ class HostsConfigManifest {
       }
       $manifest = "$" . $key . " = ";
       if ( ($key == "lzo_enabled") ||
-           ($key == "snappy_enabled") ) {
+           ($key == "snappy_enabled") || 
+           ($key == "wipeoff_data") ) {
         $manifest = $manifest . $value . "\n";
       } else {
         $manifest = $manifest . "\"" .  $value . "\"\n";