Pārlūkot izejas kodu

AMBARI-1954. Dashboard does not come up if the upgrade stack does not contain a service with the same name. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1469163 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 gadi atpakaļ
vecāks
revīzija
243173a338
2 mainītis faili ar 25 papildinājumiem un 19 dzēšanām
  1. 3 0
      CHANGES.txt
  2. 22 19
      ambari-web/app/controllers/main/admin/cluster.js

+ 3 - 0
CHANGES.txt

@@ -752,6 +752,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1954. Dashboard does not come up if the upgrade stack does not contain
+ a service with the same name. (yusaku)
+
  AMBARI-1953. On Add Hosts, the request context for the start phase shows up
  as "Request Name Not Specified". (yusaku)
 

+ 22 - 19
ambari-web/app/controllers/main/admin/cluster.js

@@ -82,25 +82,28 @@ App.MainAdminClusterController = Em.Controller.extend({
           findProperty("StackServices.service_name", displayOrderConfig[i].serviceName);
         if (entry) {
           entry = entry.StackServices;
-        if (installedServices.contains(entry.service_name)) {
-          var myService = Em.Object.create({
-            serviceName: entry.service_name,
-            displayName: displayOrderConfig[i].displayName,
-            isDisabled: i === 0,
-            isSelected: true,
-            isInstalled: false,
-            isHidden: displayOrderConfig[i].isHidden,
-            description: entry.comments,
-            version: entry.service_version,
-            newVersion: upgradeStack.stackServices.
-              findProperty("StackServices.service_name", displayOrderConfig[i].serviceName).
-              StackServices.service_version
-          });
-          //From 1.3.0 for Hive we display only "Hive" (but it install HCat and WebHCat as well)
-          if (this.get('upgradeVersion').replace(/HDP-/, '') >= '1.3.0' && displayOrderConfig[i].serviceName == 'HIVE') {
-            myService.set('displayName', 'Hive');
-          }
-          result.push(myService);
+          if (installedServices.contains(entry.service_name)) {
+            var myService = Em.Object.create({
+              serviceName: entry.service_name,
+              displayName: displayOrderConfig[i].displayName,
+              isDisabled: i === 0,
+              isSelected: true,
+              isInstalled: false,
+              isHidden: displayOrderConfig[i].isHidden,
+              description: entry.comments,
+              version: entry.service_version,
+              newVersion: ''
+            });
+            // it's possible that there is no corresponding service in the new stack
+            var matchedService = upgradeStack.stackServices.findProperty("StackServices.service_name", displayOrderConfig[i].serviceName);
+            if (matchedService) {
+              myService.newVersion = matchedService.StackServices.service_version;
+            }
+            //From 1.3.0 for Hive we display only "Hive" (but it install HCat and WebHCat as well)
+            if (this.get('upgradeVersion').replace(/HDP-/, '') >= '1.3.0' && displayOrderConfig[i].serviceName == 'HIVE') {
+              myService.set('displayName', 'Hive');
+            }
+            result.push(myService);
           }
         }
         else {