Преглед на файлове

AMBARI-342. Reconfiguration process kicks in even when the user submits without new configs changes (Contributed by Vinod)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1346606 13f79535-47bb-0310-9956-ffa450edef68
Vikram Dixit K преди 13 години
родител
ревизия
0fb207a45b
променени са 2 файла, в които са добавени 23 реда и са изтрити 4 реда
  1. 2 0
      CHANGES.txt
  2. 21 4
      hmc/js/manageServices.js

+ 2 - 0
CHANGES.txt

@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-342. Reconfiguration process kicks in even when the user submits without new configs changes (Vinod via Vikram)
+
   AMBARI-341. Batch yum commands (Ramya via Vikram)
 
   AMBARI-338. Cluster status update needs to happen for all stages of installation wizard. (Vikram)

+ 21 - 4
hmc/js/manageServices.js

@@ -3,7 +3,8 @@ var fetchClusterServicesPoller;
 var clusterServices;
 
 // Storing globally for the sake of multiple screens in reconfigure
-var reconfigureServicesData = {};
+var localReconfigureServiceData = {};
+var remoteReconfigureServiceData = {};
 var confirmationDataPanelBodyContent = '';
 
 var confirmationDataPanel;
@@ -203,12 +204,25 @@ function setupReconfigureScreens(serviceName) {
     action: function (e) {
       e.preventDefault();
 
+      localReconfigureServiceData = generateUserOpts();
+      var remoteProps = remoteReconfigureServiceData.services[serviceName].properties;
+      var localProps = localReconfigureServiceData[serviceName].properties;
+      var allEqual = true;
+      for (key in localProps) {
+        var remoteValue = remoteProps[key].value;
+        var localValue = localProps[key]["value"];
+        if ( localValue != remoteValue) {
+          allEqual = false;
+        }
+      }
+      if (allEqual) {
+        alert("You haven't made any changes");
+        return;
+      }
       hidePanel(function() {
 
         // Store the requestData and the html
         confirmationDataPanelBodyContent = confirmationDataPanel.get( 'bodyContent' );
-        reconfigureServicesData = generateUserOpts();
-
         setupReconfigureSecondScreen(serviceName);
         showPanel();
       });
@@ -245,6 +259,9 @@ function setupReconfigureScreens(serviceName) {
   executeStage( '../php/frontend/fetchClusterServices.php?clusterName=' + clusterName + 
     '&getConfigs=true&serviceName=' + serviceName, function (serviceConfigurationData) {
 
+    // Store the remote data
+    remoteReconfigureServiceData = serviceConfigurationData;
+
     var serviceConfigurationMarkup = constructDOM( serviceConfigurationData );
 
     if( globalYui.Lang.trim( serviceConfigurationMarkup).length == 0 ) {
@@ -293,7 +310,7 @@ function performServiceManagement( action, serviceName, confirmationDataPanel )
   };
 
   if( action == "reconfigure" ) {
-    manageServicesRequestData.services = reconfigureServicesData;
+    manageServicesRequestData.services = localReconfigureServiceData;
   }
   else {
     /* Need to explicitly set a key named for serviceName this way because it's