You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2017/10/05 18:55:50 UTC
ambari git commit: AMBARI-22146. New stack versions shown as 'Not
installed' on 0 hosts (alexantonenko)
Repository: ambari
Updated Branches:
refs/heads/branch-2.6 34eb22abd -> 415862712
AMBARI-22146. New stack versions shown as 'Not installed' on 0 hosts (alexantonenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/41586271
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/41586271
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/41586271
Branch: refs/heads/branch-2.6
Commit: 415862712d2503ee4d0c35bb71e56c79ebe8bdbd
Parents: 34eb22a
Author: Alex Antonenko <aa...@hortonworks.com>
Authored: Thu Oct 5 21:55:37 2017 +0300
Committer: Alex Antonenko <aa...@hortonworks.com>
Committed: Thu Oct 5 21:55:37 2017 +0300
----------------------------------------------------------------------
.../app/models/stack_version/repository_version.js | 2 +-
.../models/stack_version/repository_version_test.js | 12 +++++++++---
2 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/41586271/ambari-web/app/models/stack_version/repository_version.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_version/repository_version.js b/ambari-web/app/models/stack_version/repository_version.js
index 51b9ab8..d40b4f2 100644
--- a/ambari-web/app/models/stack_version/repository_version.js
+++ b/ambari-web/app/models/stack_version/repository_version.js
@@ -64,7 +64,7 @@ App.RepositoryVersion = DS.Model.extend({
* @type {Array}
*/
notInstalledHosts: function () {
- return Array.isArray(this.get('stackVersion.notInstalledHosts'))
+ return this.get('stackVersion.notInstalledHosts').length || this.get('stackVersion.installedHosts').length || this.get('stackVersion.currentHosts').length
? this.get('stackVersion.notInstalledHosts')
: App.get('allHostNames');
}.property('stackVersion.notInstalledHosts'),
http://git-wip-us.apache.org/repos/asf/ambari/blob/41586271/ambari-web/test/models/stack_version/repository_version_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/models/stack_version/repository_version_test.js b/ambari-web/test/models/stack_version/repository_version_test.js
index bbb98a3..2bd30de 100644
--- a/ambari-web/test/models/stack_version/repository_version_test.js
+++ b/ambari-web/test/models/stack_version/repository_version_test.js
@@ -51,15 +51,21 @@ describe('App.RepositoryVersion', function () {
App.get.restore();
});
- it("stackVersion is null", function() {
- model.set('stackVersion', null);
+ it("all states empty", function() {
+ model.set('stackVersion', Em.Object.create({
+ installedHosts: [],
+ notInstalledHosts: [],
+ currentHosts: []
+ }));
model.propertyDidChange('notInstalledHosts');
expect(model.get('notInstalledHosts')).to.eql(['host1']);
});
it("stackVersion has notInstalledHosts array", function() {
model.set('stackVersion', Em.Object.create({
- notInstalledHosts: ['host2']
+ installedHosts: [],
+ notInstalledHosts: ['host2'],
+ currentHosts: []
}));
model.propertyDidChange('notInstalledHosts');
expect(model.get('notInstalledHosts')).to.eql(['host2']);