ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject ambari git commit: AMBARI-16941. Cluster install wizard hangs and cannot proceed if Knox is the only service selected for install (alexantonenko)
Date Mon, 30 May 2016 11:18:55 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 677302795 -> a8655347a


AMBARI-16941. Cluster install wizard hangs and cannot proceed if Knox is the only service
selected for install (alexantonenko)


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

Branch: refs/heads/trunk
Commit: a8655347a311a4b9506e5e67f8a37834f4130205
Parents: 6773027
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Mon May 30 14:17:35 2016 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Mon May 30 14:18:48 2016 +0300

----------------------------------------------------------------------
 .../app/controllers/wizard/step6_controller.js  |  4 +-
 .../test/controllers/wizard/step6_test.js       | 54 ++++++++++++++++++++
 2 files changed, 56 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a8655347/ambari-web/app/controllers/wizard/step6_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step6_controller.js b/ambari-web/app/controllers/wizard/step6_controller.js
index 6090f74..9e1dce9 100644
--- a/ambari-web/app/controllers/wizard/step6_controller.js
+++ b/ambari-web/app/controllers/wizard/step6_controller.js
@@ -144,7 +144,7 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin, {
   anyGeneralIssues: Em.computed.or('anyGeneralErrors', 'anyGeneralWarnings'),
 
   anyHostErrors: function () {
-    return this.get('hosts').some(function(h) { return h.errorMessages.length > 0; });
+    return this.get('hosts').some(function(h) { return h.errorMessages ? (h.errorMessages.length
> 0) : false;});
   }.property('hosts.@each.errorMessages'),
 
   /**
@@ -153,7 +153,7 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin, {
   anyErrors: Em.computed.or('anyGeneralErrors', 'anyHostErrors'),
 
   anyHostWarnings: function () {
-    return this.get('hosts').some(function(h) { return h.warnMessages.length > 0; });
+    return this.get('hosts').some(function(h) { return h.warnMessages ? (h.warnMessages.length
> 0) : false;});
   }.property('hosts.@each.warnMessages'),
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/a8655347/ambari-web/test/controllers/wizard/step6_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step6_test.js b/ambari-web/test/controllers/wizard/step6_test.js
index 56b9e96..bfef7ea 100644
--- a/ambari-web/test/controllers/wizard/step6_test.js
+++ b/ambari-web/test/controllers/wizard/step6_test.js
@@ -1825,5 +1825,59 @@ describe('App.WizardStep6Controller', function () {
     });
 
   });
+   
+  describe('#anyHostErrors', function () {
+
+    var tests = [
+    {
+       it: "anyHostErrors returns true if errorMessages are defined",
+       host: Em.A([Em.Object.create({
+          errorMessages: "Error Message"
+       })]),
+       result: true
+     },
+     {
+       it: "anyHostErrors returns false if errorMessages are not defined",
+       host: Em.A([Em.Object.create({
+       })]),
+       result: false
+     }
+    ];
+
+    tests.forEach(function(test) {
+      it(test.it, function() {
+        controller.set('hosts', test.host);
+        expect(controller.get('anyHostErrors')).to.equal(test.result);
+      })
+    });   
+  });
+
+
+   
+  describe('#anyHostWarnings', function () {
+
+    var tests = [
+    {
+       it: "anyHostWarnings returns true if warnMessages are defined",
+       host: Em.A([Em.Object.create({
+          warnMessages: "Warning Message"
+       })]),
+       result: true
+     },
+     {
+       it: "anyHostWarnings returns false if warnMessages are not defined",
+       host: Em.A([Em.Object.create({
+       })]),
+       result: false
+     }
+    ];
+
+    tests.forEach(function(test) {
+      it(test.it, function() {
+        controller.set('hosts', test.host);
+        expect(controller.get('anyHostWarnings')).to.equal(test.result);
+      })
+    });   
+  });
 
 });


Mime
View raw message