This is an automated email from the ASF dual-hosted git repository.

akovalenko pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new de66866  AMBARI-24133. Deleting and adding the same host fails in 
Ambari (akovalenko)
de66866 is described below

commit de66866348fad4a3864825635d21771a83a252d4
Author: Aleksandr Kovalenko <akovale...@apache.org>
AuthorDate: Mon Jun 18 12:41:06 2018 +0300

    AMBARI-24133. Deleting and adding the same host fails in Ambari (akovalenko)
---
 ambari-web/app/mappers/socket/topology_mapper.js | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/ambari-web/app/mappers/socket/topology_mapper.js 
b/ambari-web/app/mappers/socket/topology_mapper.js
index becaa17..7c3293d 100644
--- a/ambari-web/app/mappers/socket/topology_mapper.js
+++ b/ambari-web/app/mappers/socket/topology_mapper.js
@@ -163,13 +163,9 @@ App.topologyMapper = App.QuickDataMapper.create({
    * @param {Array} hostComponents
    */
   updateHostComponentsOfService: function(service, hostComponents) {
-    const updatedService = {};
-    for (let i in App.serviceMapper.config) {
-      if (service.get(stringUtils.underScoreToCamelCase(i)) !== undefined) {
-        updatedService[i] = service.get(stringUtils.underScoreToCamelCase(i));
-      }
+    const cacheService = 
App.cache['services'].findProperty('ServiceInfo.service_name', 
service.get('serviceName'));
+    if (cacheService) {
+      cacheService.host_components = hostComponents;
     }
-    updatedService.host_components = hostComponents;
-    App.store.safeLoad(App.Service, updatedService);
   }
 });

-- 
To stop receiving notification emails like this one, please contact
akovale...@apache.org.

Reply via email to