AMBARI-18766. Add Service failed when none of the host components report 
version. (2nd patch) (jaimin)

(cherry picked from commit 4146ab9ce589fb4891c82da57f6f74420af67bac)

Change-Id: Iafedc473caa38d610015a0666c0a44ccf05296c4


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

Branch: refs/heads/AMBARI-2.4.2.16
Commit: fa53c623a86a561236340a487edc5fa31f3f6fe7
Parents: 553f26b
Author: Jaimin Jetly <jai...@hortonworks.com>
Authored: Wed Nov 9 18:53:41 2016 -0800
Committer: Jaimin Jetly <jai...@hortonworks.com>
Committed: Thu Nov 10 03:35:13 2016 +0000

----------------------------------------------------------------------
 ambari-web/app/controllers/wizard/step8_controller.js | 5 +++--
 ambari-web/test/controllers/wizard/step8_test.js      | 8 +++++++-
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fa53c623/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js 
b/ambari-web/app/controllers/wizard/step8_controller.js
index 237e2d8..24d8ec7 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -328,9 +328,10 @@ App.WizardStep8Controller = 
Em.Controller.extend(App.AddSecurityConfigs, App.wiz
    * @method loadRepoInfo
    */
   loadRepoInfo: function () {
-
-    var currentRepoVersion = App.get('currentStackVersionNumber');
     var stackName = App.get('currentStackName');
+    var currentStackVersionNumber = App.get('currentStackVersionNumber');
+    var currentStackVersion = App.StackVersion.find().filterProperty('stack', 
stackName).findProperty('version', currentStackVersionNumber);
+    var currentRepoVersion = 
currentStackVersion.get('repositoryVersion.repositoryVersion');
 
     return App.ajax.send({
       name: 'cluster.load_repo_version',

http://git-wip-us.apache.org/repos/asf/ambari/blob/fa53c623/ambari-web/test/controllers/wizard/step8_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step8_test.js 
b/ambari-web/test/controllers/wizard/step8_test.js
index 3abe2cb..5efb866 100644
--- a/ambari-web/test/controllers/wizard/step8_test.js
+++ b/ambari-web/test/controllers/wizard/step8_test.js
@@ -639,11 +639,17 @@ describe('App.WizardStep8Controller', function () {
     beforeEach(function () {
       var stubForGet = sinon.stub(App, 'get');
       stubForGet.withArgs('currentStackName').returns('HDP');
-      stubForGet.withArgs('currentStackVersionNumber').returns('2.3.0.0-2208');
+      stubForGet.withArgs('currentStackVersionNumber').returns('2.3');
+      sinon.stub(App.StackVersion, 'find', function() {
+        return [
+          Em.Object.create({state: 'NOT_CURRENT', stack: 'HDP', version: 
'2.3', repositoryVersion: {repositoryVersion: '2.3.0.0-2208'}})
+        ];
+      });
     });
 
     afterEach(function () {
       App.get.restore();
+      App.StackVersion.find.restore();
     });
     it('should use current StackVersion', function() {
       installerStep8Controller.loadRepoInfo();

Reply via email to