ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oleew...@apache.org
Subject [22/50] ambari git commit: AMBARI-20379. Error during moving ResourceManager without Tez installed (akovalenko)
Date Fri, 10 Mar 2017 20:46:50 GMT
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/8ce47e0c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8ce47e0c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8ce47e0c

Branch: refs/heads/branch-dev-logsearch
Commit: 8ce47e0cbd5caaaee7f444ddca1afefafceede1d
Parents: a101205
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Thu Mar 9 16:33:17 2017 +0200
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Thu Mar 9 17:59:16 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/8ce47e0c/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/8ce47e0c/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();
     });
 


Mime
View raw message