Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 245fd5cf3 -> c6a9a3ca4


AMBARI-20379. Error during moving ResourceManager without Tez installed 
(akovalenko)


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

Branch: refs/heads/branch-2.5
Commit: c6a9a3ca49559e64858a25d5be916296ccd91c1f
Parents: 245fd5c
Author: Aleksandr Kovalenko <akovale...@hortonworks.com>
Authored: Thu Mar 9 16:33:17 2017 +0200
Committer: Aleksandr Kovalenko <akovale...@hortonworks.com>
Committed: Thu Mar 9 18:00:05 2017 +0200

----------------------------------------------------------------------
 .../main/service/reassign/step4_controller.js    | 17 +++++++++--------
 .../service/reassign/step4_controller_test.js    | 19 +++++++++++++++++--
 2 files changed, 26 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c6a9a3ca/ambari-web/app/controllers/main/service/reassign/step4_controller.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/controllers/main/service/reassign/step4_controller.js 
b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
index f87d05b..9a40283 100644
--- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
@@ -106,16 +106,17 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
    * Set dependent host-components to <code>dependentHostComponents</code>
    * @param {string} componentName
    */
-  setDependentHostComponents: function(componentName) {
+  setDependentHostComponents: function (componentName) {
+    var installedServices = App.Service.find().mapProperty('serviceName');
     var installedComponents = 
App.Host.find(this.get('content.reassignHosts.target'))
-      .get('hostComponents')
-      .mapProperty('componentName');
+        .get('hostComponents')
+        .mapProperty('componentName');
     var dependenciesToInstall = App.StackServiceComponent.find(componentName)
-      .get('dependencies')
-      .mapProperty('componentName')
-      .filter(function(component) {
-        return !installedComponents.contains(component);
-      });
+        .get('dependencies')
+        .filter(function (component) {
+          return !installedComponents.contains(component.componentName) && 
installedServices.contains(component.serviceName);
+        })
+        .mapProperty('componentName');
     this.set('dependentHostComponents', dependenciesToInstall);
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c6a9a3ca/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js 
b/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
index 612efd0..0b00412 100644
--- a/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
+++ b/ambari-web/test/controllers/main/service/reassign/step4_controller_test.js
@@ -1090,19 +1090,34 @@ describe('App.ReassignMasterWizardStep4Controller', 
function () {
           })
         ]
       }));
+      sinon.stub(App.Service, 'find').returns([
+        Em.Object.create({
+          serviceName: 'S1'
+        }),
+        Em.Object.create({
+          serviceName: 'S2'
+        })
+      ]);
       sinon.stub(App.StackServiceComponent, 'find').returns(Em.Object.create({
         dependencies: [
           Em.Object.create({
-            componentName: 'C1'
+            componentName: 'C1',
+            serviceName: 'S1'
+          }),
+          Em.Object.create({
+            componentName: 'C2',
+            serviceName: 'S2'
           }),
           Em.Object.create({
-            componentName: 'C2'
+            componentName: 'C3',
+            serviceName: 'S3'
           })
         ]
       }));
     });
     afterEach(function() {
       App.Host.find.restore();
+      App.Service.find.restore();
       App.StackServiceComponent.find.restore();
     });
 

Reply via email to