incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vik...@apache.org
Subject svn commit: r1347239 - in /incubator/ambari/branches/ambari-186: CHANGES.txt hmc/php/frontend/deployPostProcess.php hmc/php/frontend/fetchTxnProgress.php hmc/php/frontend/uninstallCleanup.php
Date Thu, 07 Jun 2012 00:59:19 GMT
Author: vikram
Date: Thu Jun  7 00:59:19 2012
New Revision: 1347239

URL: http://svn.apache.org/viewvc?rev=1347239&view=rev
Log:
AMBARI-435. Uninstall needs to update status for failure. (Contributed by Vikram)

Modified:
    incubator/ambari/branches/ambari-186/CHANGES.txt
    incubator/ambari/branches/ambari-186/hmc/php/frontend/deployPostProcess.php
    incubator/ambari/branches/ambari-186/hmc/php/frontend/fetchTxnProgress.php
    incubator/ambari/branches/ambari-186/hmc/php/frontend/uninstallCleanup.php

Modified: incubator/ambari/branches/ambari-186/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/CHANGES.txt?rev=1347239&r1=1347238&r2=1347239&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/CHANGES.txt (original)
+++ incubator/ambari/branches/ambari-186/CHANGES.txt Thu Jun  7 00:59:19 2012
@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-435. Uninstall needs to update status for failure. (Vikram)
+
   AMBARI-434. fix display name in smoke test progress description (Hitesh via Vikram)
 
   AMBARI-433. Using service stop instead of killall for uninstall (Vikram)

Modified: incubator/ambari/branches/ambari-186/hmc/php/frontend/deployPostProcess.php
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/php/frontend/deployPostProcess.php?rev=1347239&r1=1347238&r2=1347239&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/php/frontend/deployPostProcess.php (original)
+++ incubator/ambari/branches/ambari-186/hmc/php/frontend/deployPostProcess.php Thu Jun  7
00:59:19 2012
@@ -19,11 +19,11 @@ function deployPostProcess($clusterName,
   $result = 0;
   $error = "";
 
-  $txnStatus = $dbAccessor->getTransactionStatusInfo($clusterName, $txnId);
-  if ($txnStatus['result'] != 0) {
+  $txnStatusInfo = $dbAccessor->getTransactionStatusInfo($clusterName, $txnId);
+  if ($txnStatusInfo['result'] != 0) {
     $logger->log_error("Deploy post process get txn info failed");
-    $result = $txnStatus['result'];
-    $error = $txnStatus['error'];
+    $result = $txnStatusInfo['result'];
+    $error = $txnStatusInfo['error'];
     return (array("result" => $result, "error" => $error));
   }
 

Modified: incubator/ambari/branches/ambari-186/hmc/php/frontend/fetchTxnProgress.php
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/php/frontend/fetchTxnProgress.php?rev=1347239&r1=1347238&r2=1347239&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/php/frontend/fetchTxnProgress.php (original)
+++ incubator/ambari/branches/ambari-186/hmc/php/frontend/fetchTxnProgress.php Thu Jun  7
00:59:19 2012
@@ -711,6 +711,7 @@ if (($progress['processRunning'] == FALS
       $retval = $postProcessFunc($clusterName, $deployUser, $txnId, $progress);
       if ($retval["result"] != 0) {
         $progress['encounteredError'] = TRUE;
+        $lastTransaction['progress'] = "FAILED";
         break;
       }
     }

Modified: incubator/ambari/branches/ambari-186/hmc/php/frontend/uninstallCleanup.php
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/ambari-186/hmc/php/frontend/uninstallCleanup.php?rev=1347239&r1=1347238&r2=1347239&view=diff
==============================================================================
--- incubator/ambari/branches/ambari-186/hmc/php/frontend/uninstallCleanup.php (original)
+++ incubator/ambari/branches/ambari-186/hmc/php/frontend/uninstallCleanup.php Thu Jun  7
00:59:19 2012
@@ -21,6 +21,21 @@ function deBootStrap ($clusterName, $dep
 {
   global $logger, $dbAccessor, $stagesInfo;
 
+  $txnStatus = !($progressInfo['encounteredError']);
+
+  // do not go ahead with the cleanup. 
+  // Update the state of the cluster.
+  if (!$txnStatus) {
+    $state = "UNINSTALLED";
+    $displayName = "Uninstall failed";
+    $context = array (
+      'status' => $txnStatus,
+      'txnId' => $txnId
+    );
+    $retval = updateClusterState($clusterName, $state, $displayName, $context);
+    return $retval;
+  }
+
   /////// launch the stages in the background.
   $stagesFile = "./uninstall/stages.php";
   $logger->log_debug("ClusterName: $clusterName\n");



Mime
View raw message