ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject git commit: AMBARI-6964. List of services from Non-HDP stack is not available on UI. (jaimin)
Date Fri, 22 Aug 2014 23:40:41 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 8b9026442 -> ee275bf4d


AMBARI-6964. List of services from Non-HDP stack is not available on UI. (jaimin)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ee275bf4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ee275bf4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ee275bf4

Branch: refs/heads/trunk
Commit: ee275bf4d73823c2afc2f23dd49e3428be36e5ec
Parents: 8b90264
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Fri Aug 22 16:40:15 2014 -0700
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Fri Aug 22 16:40:25 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/app.js                           | 30 +++++++-------------
 ambari-web/app/config.js                        |  1 -
 .../app/controllers/main/admin/repositories.js  |  8 ++++--
 ambari-web/app/utils/ajax/ajax.js               |  2 +-
 ambari-web/app/views/main/admin/repositories.js |  4 +--
 ambari-web/test/app_test.js                     | 14 +++++++--
 .../test/controllers/wizard/step4_test.js       |  6 ++--
 7 files changed, 35 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ee275bf4/ambari-web/app/app.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/app.js b/ambari-web/app/app.js
index bd1f45a..f4dd1c1 100644
--- a/ambari-web/app/app.js
+++ b/ambari-web/app/app.js
@@ -38,23 +38,8 @@ module.exports = Em.Application.create({
    * return url prefix with number value of version of HDP stack
    */
   stackVersionURL: function () {
-    var stackVersion = this.get('currentStackVersion') || this.get('defaultStackVersion');
-    if (stackVersion.indexOf('HDPLocal') !== -1) {
-      return '/stacks/HDPLocal/versions/' + stackVersion.replace(/HDPLocal-/g, '');
-    }
-    return '/stacks/HDP/versions/' + stackVersion.replace(/HDP-/g, '');
-  }.property('currentStackVersion'),
-
-  /**
-   * return url prefix with number value of version of HDP stack
-   */
-  stack2VersionURL: function () {
-    var stackVersion = this.get('currentStackVersion') || this.get('defaultStackVersion');
-    if (stackVersion.indexOf('HDPLocal') !== -1) {
-      return '/stacks2/HDPLocal/versions/' + stackVersion.replace(/HDPLocal-/g, '');
-    }
-    return '/stacks2/HDP/versions/' + stackVersion.replace(/HDP-/g, '');
-  }.property('currentStackVersion'),
+    return '/stacks/{0}/versions/{1}'.format(this.get('currentStackName') || 'HDP', this.get('currentStackVersionNumber'));
+  }.property('currentStackName','currentStackVersionNumber'),
 
   falconServerURL: function () {
     var falconService = this.Service.find().findProperty('serviceName', 'FALCON');
@@ -67,13 +52,20 @@ module.exports = Em.Application.create({
   clusterName: null,
   clockDistance: null, // server clock - client clock
   currentStackVersion: '',
-  currentStackVersionNumber: function () {
-    return this.get('currentStackVersion').replace(/HDP(Local)?-/, '');
+  currentStackName: function() {
+    return Em.get((this.get('currentStackVersion') || this.get('defaultStackVersion')).match(/(.+)-\d.+/),
'1');
   }.property('currentStackVersion'),
+
+  currentStackVersionNumber: function () {
+    var regExp = new RegExp(this.get('currentStackName') + '-');
+    return (this.get('currentStackVersion') || this.get('defaultStackVersion')).replace(regExp,
'');
+  }.property('currentStackVersion', 'currentStackName'),
+
   isHadoop2Stack: function () {
     return (stringUtils.compareVersions(this.get('currentStackVersionNumber'), "2.0") ===
1 ||
       stringUtils.compareVersions(this.get('currentStackVersionNumber'), "2.0") === 0)
   }.property('currentStackVersionNumber'),
+
   isHadoop21Stack: function () {
     return (stringUtils.compareVersions(this.get('currentStackVersionNumber'), "2.1") ===
1 ||
       stringUtils.compareVersions(this.get('currentStackVersionNumber'), "2.1") === 0)

http://git-wip-us.apache.org/repos/asf/ambari/blob/ee275bf4/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index f4e882a..be1fd97 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -28,7 +28,6 @@ App.testEnableSecurity = true; // By default enable security is tested;
turning
 App.testNameNodeHA = true;
 App.apiPrefix = '/api/v1';
 App.defaultStackVersion = 'HDP-2.0.5';
-App.defaultLocalStackVersion = 'HDPLocal-2.0.5';
 App.defaultJavaHome = '/usr/jdk/jdk1.6.0_31';
 App.timeout = 180000; // default AJAX timeout
 App.maxRetries = 3; // max number of retries for certain AJAX calls

http://git-wip-us.apache.org/repos/asf/ambari/blob/ee275bf4/ambari-web/app/controllers/main/admin/repositories.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/repositories.js b/ambari-web/app/controllers/main/admin/repositories.js
index d233031..a314e71 100644
--- a/ambari-web/app/controllers/main/admin/repositories.js
+++ b/ambari-web/app/controllers/main/admin/repositories.js
@@ -31,6 +31,9 @@ App.MainAdminRepositoriesController = Em.Controller.extend({
     if (App.router.get('clusterController.isLoaded')) {
       App.ajax.send({
         name: 'cluster.update_upgrade_version',
+        data: {
+          stackName: App.get('currentStackName')
+        },
         sender: this,
         success: 'updateUpgradeVersionSuccessCallback',
         error: 'updateUpgradeVersionErrorCallback'
@@ -41,7 +44,8 @@ App.MainAdminRepositoriesController = Em.Controller.extend({
   updateUpgradeVersionSuccessCallback: function (data) {
     var upgradeVersion = this.get('upgradeVersion') || App.get('defaultStackVersion');
     var currentVersion = App.get('currentStackVersionNumber');
-    upgradeVersion = upgradeVersion.replace(/HDP-/, '');
+    var stackNamePrefix = App.get('currentStackName') + '-';
+    upgradeVersion = upgradeVersion.replace(stackNamePrefix, '');
     data.items.mapProperty('Versions.stack_version').forEach(function (version) {
       upgradeVersion = (stringUtils.compareVersions(upgradeVersion, version) === -1) ? version
: upgradeVersion;
     });
@@ -52,7 +56,7 @@ App.MainAdminRepositoriesController = Em.Controller.extend({
       upgradeVersion = currentVersion;
       upgradeStack = currentStack;
     }
-    upgradeVersion = 'HDP-' + upgradeVersion;
+    upgradeVersion = stackNamePrefix + upgradeVersion;
     this.set('upgradeVersion', upgradeVersion);
     if (currentStack && upgradeStack) {
       this.parseServicesInfo(currentStack, upgradeStack);

http://git-wip-us.apache.org/repos/asf/ambari/blob/ee275bf4/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index 4213bc5..987696c 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -879,7 +879,7 @@ var urls = {
     'mock': '/data/clusters/info.json'
   },
   'cluster.update_upgrade_version': {
-    'real': '/stacks/HDP/versions?fields=stackServices/StackServices,Versions',
+    'real': '/stacks/{stackName}/versions?fields=stackServices/StackServices,Versions',
     'mock': '/data/wizard/stack/stacks.json'
   },
   'cluster.load_repositories': {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ee275bf4/ambari-web/app/views/main/admin/repositories.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/repositories.js b/ambari-web/app/views/main/admin/repositories.js
index dfbb123..db234bf 100644
--- a/ambari-web/app/views/main/admin/repositories.js
+++ b/ambari-web/app/views/main/admin/repositories.js
@@ -23,8 +23,8 @@ App.MainAdminRepositoriesView = Em.View.extend({
   templateName: require('templates/main/admin/repositories'),
 
   isUpgradeAvailable: function(){
-    return stringUtils.compareVersions(this.get('controller.upgradeVersion').replace(/HDP(Local)?-/,
''), App.get('currentStackVersionNumber')) === 1;
-  }.property('controller.upgradeVersion', 'App.currentStackVersion'),
+    return stringUtils.compareVersions(this.get('controller.upgradeVersion').replace(App.get('currentStackName')
+ '-', ''), App.get('currentStackVersionNumber')) === 1;
+  }.property('controller.upgradeVersion', 'App.currentStackName','App.currentStackVersionNumber'),
 
   didInsertElement: function () {
     this.get('controller').loadRepositories();

http://git-wip-us.apache.org/repos/asf/ambari/blob/ee275bf4/ambari-web/test/app_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/app_test.js b/ambari-web/test/app_test.js
index 4367797..c16d5f0 100644
--- a/ambari-web/test/app_test.js
+++ b/ambari-web/test/app_test.js
@@ -197,7 +197,12 @@ describe('App', function () {
         result: '1.3.1'
       }
     ];
-
+    before(function() {
+      App.set('defaultStackVersion', '');
+    });
+    after(function() {
+      App.set('defaultStackVersion', 'HDP-2.0.5');
+    });
     testCases.forEach(function (test) {
       it(test.title, function () {
         App.set('currentStackVersion', test.currentStackVersion);
@@ -208,7 +213,12 @@ describe('App', function () {
   });
 
   describe('#isHadoop2Stack', function () {
-
+    before(function() {
+      App.set('defaultStackVersion', '');
+    });
+    after(function() {
+      App.set('defaultStackVersion', 'HDP-2.0.5');
+    });
     var testCases = [
       {
         title: 'if currentStackVersion is empty then isHadoop2Stack should be false',

http://git-wip-us.apache.org/repos/asf/ambari/blob/ee275bf4/ambari-web/test/controllers/wizard/step4_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step4_test.js b/ambari-web/test/controllers/wizard/step4_test.js
index 9e54e92..ca693e4 100644
--- a/ambari-web/test/controllers/wizard/step4_test.js
+++ b/ambari-web/test/controllers/wizard/step4_test.js
@@ -271,7 +271,7 @@ describe('App.WizardStep4Controller', function () {
       },
       {
         services: ['ZOOKEEPER'],
-        errorsExpected: ['fsCheck', 'monitoringCheck']
+        errorsExpected: ['monitoringCheck']
       },
       {
         services: ['HDFS'],
@@ -321,8 +321,8 @@ describe('App.WizardStep4Controller', function () {
       },
       {
         services: ['ZOOKEEPER'],
-        confirmPopupCount: 2,
-        errorsExpected: ['fsCheck', 'monitoringCheck']
+        confirmPopupCount: 1,
+        errorsExpected: ['monitoringCheck']
       },
       {
         services: ['HDFS', 'GLUSTERFS', 'ZOOKEEPER', 'HIVE'],


Mime
View raw message