ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject ambari git commit: AMBARI-17580. Ambari-web unable to automatically add MASTER component with cardinality ALL on all nodes. (Shantanu Mundkur via Jaimin)
Date Fri, 08 Jul 2016 20:30:25 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 43785d418 -> e873a685f


AMBARI-17580. Ambari-web unable to automatically add MASTER component with cardinality ALL
on all nodes. (Shantanu Mundkur via Jaimin)


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

Branch: refs/heads/branch-2.4
Commit: e873a685f00eab72cbd3d86f15d977db85354762
Parents: 43785d4
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Fri Jul 8 13:33:33 2016 -0700
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Fri Jul 8 13:33:33 2016 -0700

----------------------------------------------------------------------
 .../app/controllers/wizard/step8_controller.js  |  4 +-
 .../test/controllers/wizard/step8_test.js       | 98 +++++++++++++++++++-
 2 files changed, 99 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e873a685/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 f5c92ec..0ad68ed 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1155,7 +1155,7 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs,
App.wiz
       if (masterOnAllHosts.length > 0) {
         var compOnAllHosts = false;
         for (var i=0; i < masterOnAllHosts.length; i++) {
-          if (component.component_name == masterOnAllHosts[i]) {
+          if (component == masterOnAllHosts[i]) {
             compOnAllHosts = true;
             break;
           }
@@ -1227,7 +1227,7 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs,
App.wiz
         if (slaveOnAllHosts.length > 0) {
           var compOnAllHosts = false;
           for (var i=0; i < slaveOnAllHosts.length; i++) {
-            if (_slave.component_name == slaveOnAllHosts[i]) {
+            if (_slave.componentName == slaveOnAllHosts[i]) {
               // component with ALL cardinality should not
               // registerHostsToComponent in createSlaveAndClientsHostComponents
               compOnAllHosts = true;

http://git-wip-us.apache.org/repos/asf/ambari/blob/e873a685/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 6bad1fb..9214631 100644
--- a/ambari-web/test/controllers/wizard/step8_test.js
+++ b/ambari-web/test/controllers/wizard/step8_test.js
@@ -1540,7 +1540,103 @@ describe('App.WizardStep8Controller', function () {
         });
       });
 
-      describe('should not add components with isRequiredOnAllHosts == false (2)', function()
{
+      describe('should add components with isRequiredOnAllHosts == true (2)', function()
{
+
+        beforeEach(function () {
+          installerStep8Controller.reopen({
+            getRegisteredHosts: function() {
+              return [{hostName: 'h1'}, {hostName: 'h2'}];
+            },
+            content: {
+              services: Em.A([
+                Em.Object.create({
+                  serviceName: 'ANYSERVICE', isSelected: true, isInstalled: false, serviceComponents:
[
+                    // set isRequiredOnAllHosts = true for master
+                    Em.Object.create({
+                      componentName: 'ANYSERVICE_MASTER',
+                      isMaster: true,
+                      isRequiredOnAllHosts: true
+                    }),
+                    Em.Object.create({
+                      componentName: 'ANYSERVICE_SLAVE',
+                      isSlave: true,
+                      isRequiredOnAllHosts: false
+                    }),
+                    Em.Object.create({
+                      componentName: 'ANYSERVICE_SLAVE2',
+                      isSlave: true,
+                      isRequiredOnAllHosts: false
+                    }),
+                    Em.Object.create({
+                      componentName: 'ANYSERVICE_CLIENT',
+                      isClient: true,
+                      isRequiredOnAllHosts: false
+                    })
+                  ]
+                })
+              ]),
+              masterComponentHosts: Em.A([
+                Em.Object.create({
+                  componentName: 'ANYSERVICE_MASTER',
+                  component: 'ANYSERVICE_MASTER',
+                  hosts: Em.A([
+                    Em.Object.create({hostName: 'h1', isInstalled: true})
+                  ])
+                })
+              ]),
+              slaveComponentHosts: Em.A([
+                Em.Object.create({
+                  componentName: 'ANYSERVICE_SLAVE',
+                  hosts: Em.A([
+                    Em.Object.create({hostName: 'h1', isInstalled: false}),
+                    Em.Object.create({hostName: 'h2', isInstalled: false})
+                  ])
+                }),
+                Em.Object.create({
+                  componentName: 'ANYSERVICE_SLAVE2',
+                  hosts: Em.A([
+                    Em.Object.create({hostName: 'h1', isInstalled: false}),
+                    Em.Object.create({hostName: 'h2', isInstalled: false})
+                  ])
+                }),
+                Em.Object.create({
+                  componentName: 'CLIENT',
+                  hosts: Em.A([
+                    Em.Object.create({hostName: 'h1', isInstalled: false}),
+                    Em.Object.create({hostName: 'h2', isInstalled: false})
+                  ])
+                })
+              ]),
+              clients: Em.A([
+                Em.Object.create({
+                  component_name: 'ANYSERVICE_CLIENT',
+                  isInstalled: false,
+                  hosts: Em.A([
+                    Em.Object.create({hostName: 'h1', isInstalled: false}),
+                    Em.Object.create({hostName: 'h2', isInstalled: false})
+                  ])
+                })
+              ])
+            }
+          });
+          installerStep8Controller.set('ajaxRequestsQueue', App.ajaxQueue.create());
+          installerStep8Controller.get('ajaxRequestsQueue').clear();
+          installerStep8Controller.createMasterHostComponents();
+          installerStep8Controller.createAdditionalHostComponents();
+        });
+
+        // master component with isRequiredOnAllHosts = true implies that
+        // registerHostsToComponent would be done via
+        // createAdditionalHostComponents() BUT NOT
+        // createMasterHostComponents()
+        it('registerHostsToComponent 1st call', function () {
+          expect(installerStep8Controller.registerHostsToComponent.args[0][0]).to.eql(['h1',
'h2']);
+          expect(installerStep8Controller.registerHostsToComponent.args[0][1]).to.equal('ANYSERVICE_MASTER');
+          expect(installerStep8Controller.registerHostsToComponent.callCount).to.equal(1);
+        });
+      });
+
+      describe('should not add components with isRequiredOnAllHosts == false (3)', function()
{
 
         beforeEach(function () {
           installerStep8Controller.reopen({


Mime
View raw message