ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-17549 Client Install Failed icon appears even after reinstall. (akovalenko)
Date Tue, 13 Sep 2016 12:26:28 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 5c4194253 -> 673f524b1


AMBARI-17549 Client Install Failed icon appears even after reinstall. (akovalenko)


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

Branch: refs/heads/branch-2.5
Commit: 673f524b165915c451195de6252c7268b042d1eb
Parents: 5c41942
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Mon Jul 4 15:54:09 2016 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Tue Sep 13 15:25:19 2016 +0300

----------------------------------------------------------------------
 ambari-web/app/views/main/host/summary.js       |  6 ++----
 ambari-web/test/views/main/host/summary_test.js | 13 +++++++++++++
 2 files changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/673f524b/ambari-web/app/views/main/host/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/summary.js b/ambari-web/app/views/main/host/summary.js
index ebef6e6..840b93f 100644
--- a/ambari-web/app/views/main/host/summary.js
+++ b/ambari-web/app/views/main/host/summary.js
@@ -181,14 +181,12 @@ App.MainHostSummaryView = Em.View.extend(App.TimeRangeMixin, {
           clients[clients.length - 1].set('isLast', false);
         }
         component.set('isLast', true);
-        if (['INSTALL_FAILED', 'INIT'].contains(component.get('workStatus'))) {
-          component.set('isInstallFailed', true);
-        }
+        component.set('isInstallFailed', ['INSTALL_FAILED', 'INIT'].contains(component.get('workStatus')));
         clients.push(component);
       }
     }, this);
     return clients;
-  }.property('content.hostComponents.length'),
+  }.property('content.hostComponents.length', 'content.hostComponents.@each.workStatus'),
 
   anyClientFailedToInstall: Em.computed.someBy('clients', 'isInstallFailed', true),
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/673f524b/ambari-web/test/views/main/host/summary_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/host/summary_test.js b/ambari-web/test/views/main/host/summary_test.js
index 62d04f1..4c91dea 100644
--- a/ambari-web/test/views/main/host/summary_test.js
+++ b/ambari-web/test/views/main/host/summary_test.js
@@ -216,6 +216,19 @@ describe('App.MainHostSummaryView', function() {
       });
     });
 
+    it('should set isInstallFailed for clients with INIT and INSTALL_FAILED workStatus',
function() {
+      mainHostSummaryView.set('content', Em.Object.create({
+        hostComponents: [
+          Em.Object.create({isMaster: false, isSlave: false, componentName: 'B', workStatus:
'INIT'}),
+          Em.Object.create({isMaster: false, isSlave: false, componentName: 'A', workStatus:
'INSTALLED'}),
+          Em.Object.create({isMaster: false, isSlave: false, componentName: 'C', workStatus:
'INSTALL_FAILED'}),
+          Em.Object.create({isMaster: false, isSlave: false, componentName: 'D', workStatus:
'INSTALLING'})
+        ]
+      }));
+      expect(mainHostSummaryView.get('clients').filterProperty('isInstallFailed', true).mapProperty('componentName')).to.eql(['B',
'C']);
+      expect(mainHostSummaryView.get('clients').filterProperty('isInstallFailed', false).mapProperty('componentName')).to.eql(['A',
'D']);
+    });
+
   });
 
   describe('#areClientWithStaleConfigs', function() {


Mime
View raw message