Browse Source

AMBARI-2210. Hadoop 2 stack version check should be integer based instead of string. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1487200 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 years ago
parent
commit
8c9d81e424

+ 3 - 0
CHANGES.txt

@@ -899,6 +899,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-2210.  Hadoop 2 stack version check should be integer based instead of
+ string. (yusaku)
+
  AMBARI-2208. Reassign Master Wizard: refreshing page on step 2, 3 or 4 breaks
  wizard. (yusaku)
 

+ 3 - 1
ambari-web/app/controllers/wizard/step8_controller.js

@@ -17,6 +17,7 @@
  */
 
 var App = require('app');
+var stringUtils = require('utils/string_utils');
 
 App.WizardStep8Controller = Em.Controller.extend({
   name: 'wizardStep8Controller',
@@ -1417,7 +1418,8 @@ App.WizardStep8Controller = Em.Controller.extend({
     var hdfsProperties = {};
     hdfsSiteObj.forEach(function (_configProperty) {
 
-      if (App.get('currentStackVersionNumber') >= '2.0.0') {
+      if (stringUtils.compareVersions(App.get('currentStackVersionNumber'), '2.0.0') === 1 ||
+          stringUtils.compareVersions(App.get('currentStackVersionNumber'), '2.0.0') === 0) {
         // TODO Remove temporary hack. This was added to not set
         // dfs.hosts and dfs.hosts.exclude properties on HDP 2 stacks.
         if ("dfs.hosts"==_configProperty.name || "dfs.hosts.exclude"==_configProperty.name) {

+ 2 - 1
ambari-web/app/views/main/admin/cluster.js

@@ -17,11 +17,12 @@
  */
 
 var App = require('app');
+var stringUtils = require('utils/string_utils');
 
 App.MainAdminClusterView = Em.View.extend({
   templateName: require('templates/main/admin/cluster'),
 
   isUpgradeAvailable: function(){
-    return this.get('controller.upgradeVersion').replace(/HDP-/, '') > App.get('currentStackVersionNumber');
+    return stringUtils.compareVersions(this.get('controller.upgradeVersion').replace(/HDP(Local)?-/, ''), App.get('currentStackVersionNumber')) === 1;
   }.property('controller.upgradeVersion', 'App.currentStackVersion')
 });