ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-16900 Delete Host message is incorrect, suggests all Clients will be deleted from cluster. (atkach)
Date Fri, 27 May 2016 09:25:13 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 5ecd3244d -> bcf0d75d5


AMBARI-16900 Delete Host message is incorrect, suggests all Clients will be deleted from cluster.
(atkach)


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

Branch: refs/heads/branch-2.4
Commit: bcf0d75d54930fed7c918aee3d8dd23b615a1e44
Parents: 5ecd324
Author: Andrii Tkach <atkach@apache.org>
Authored: Thu May 26 18:09:45 2016 +0300
Committer: Andrii Tkach <atkach@apache.org>
Committed: Fri May 27 12:24:20 2016 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/main/host/details.js       | 6 ++----
 ambari-web/test/controllers/main/host/details_test.js | 4 ++++
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bcf0d75d/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index 07991b0..1364adf 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -2067,7 +2067,6 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
    */
   getHostComponentsInfo: function () {
     var componentsOnHost = this.get('content.hostComponents');
-    var allComponents = App.HostComponent.find();
     var stoppedStates = [App.HostComponentStatus.stopped,
       App.HostComponentStatus.install_failed,
       App.HostComponentStatus.upgrade_failed,
@@ -2082,13 +2081,12 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
       unknownComponents: [],
       toDecommissionComponents: []
     };
-    var self = this;
     if (componentsOnHost && componentsOnHost.get('length') > 0) {
       componentsOnHost.forEach(function (cInstance) {
         if (cInstance.get('componentName') === 'ZOOKEEPER_SERVER') {
           container.zkServerInstalled = true;
         }
-        if (allComponents.filterProperty('componentName', cInstance.get('componentName')).get('length')
=== 1) {
+        if (this.getTotalComponent(cInstance) === 1) {
           container.lastComponents.push(cInstance.get('displayName'));
         }
         var workStatus = cInstance.get('workStatus');
@@ -2107,7 +2105,7 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
         if (App.get('components.decommissionAllowed').contains(cInstance.get('componentName'))
&& !cInstance.get('view.isComponentRecommissionAvailable')) {
           container.toDecommissionComponents.push(cInstance.get('displayName'));
         }
-      });
+      }, this);
     }
     return container;
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/bcf0d75d/ambari-web/test/controllers/main/host/details_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/host/details_test.js b/ambari-web/test/controllers/main/host/details_test.js
index db061a7..66bd454 100644
--- a/ambari-web/test/controllers/main/host/details_test.js
+++ b/ambari-web/test/controllers/main/host/details_test.js
@@ -1998,10 +1998,13 @@ describe('App.MainHostDetailsController', function () {
         id: 'TASKTRACKER_host1',
         componentName: 'TASKTRACKER'
       }]);
+      this.mockTotal = sinon.stub(controller, 'getTotalComponent');
+      this.mockTotal.returns(2);
     });
 
     afterEach(function () {
       this.stub.restore();
+      this.mockTotal.restore();
     });
 
     it('content.hostComponents is null', function () {
@@ -2035,6 +2038,7 @@ describe('App.MainHostDetailsController', function () {
           isDeletable: true
         })]
       });
+      this.mockTotal.returns(1);
       expect(controller.getHostComponentsInfo().lastComponents).to.eql(['TaskTracker']);
     });
 


Mime
View raw message