You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2018/11/30 07:09:26 UTC

[ambari] branch revert-2664-AMBARI-24966-trunk created (now df0302f)

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

jaimin pushed a change to branch revert-2664-AMBARI-24966-trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git.


      at df0302f  Revert "AMBARI-24966 Start Namenode failing during Move master NN wizard on non-HA cluster with custom hdfs service user"

This branch includes the following new commits:

     new df0302f  Revert "AMBARI-24966 Start Namenode failing during Move master NN wizard on non-HA cluster with custom hdfs service user"

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[ambari] 01/01: Revert "AMBARI-24966 Start Namenode failing during Move master NN wizard on non-HA cluster with custom hdfs service user"

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jaimin pushed a commit to branch revert-2664-AMBARI-24966-trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git

commit df0302f4d3265ba54ea4bb177a6ceb90f85fac67
Author: Jetly <ja...@hortonworks.com>
AuthorDate: Thu Nov 29 23:09:18 2018 -0800

    Revert "AMBARI-24966 Start Namenode failing during Move master NN wizard on non-HA cluster with custom hdfs service user"
---
 .../highAvailability/nameNode/wizard_controller.js | 22 ++++++++++++++--------
 .../main/service/reassign_controller.js            | 13 ++-----------
 .../main/service/reassign_controller_test.js       | 18 ------------------
 3 files changed, 16 insertions(+), 37 deletions(-)

diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js
index 0c658cd..eebcd6e 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/wizard_controller.js
@@ -198,14 +198,20 @@ App.HighAvailabilityWizardController = App.WizardController.extend({
         type: 'async',
         callback: function () {
           var dfd = $.Deferred(),
-            self = this;
-            
-          this.loadHdfsUserFromServer().done(function (data) {
-            self.set('content.hdfsUser', Em.get(data, '0.properties.hdfs_user'));
-            self.saveHdfsUser();
-            self.load('cluster');
-            dfd.resolve();
-          });
+            self = this,
+            usersLoadingCallback = function () {
+              self.saveHdfsUser();
+              self.load('cluster');
+              dfd.resolve();
+            };
+          if (App.db.getHighAvailabilityWizardHdfsUser()) {
+            usersLoadingCallback();
+          } else {
+            this.loadHdfsUserFromServer().done(function (data) {
+              self.set('content.hdfsUser', Em.get(data, '0.properties.hdfs_user'));
+              usersLoadingCallback();
+            });
+          }
           return dfd.promise();
         }
       }
diff --git a/ambari-web/app/controllers/main/service/reassign_controller.js b/ambari-web/app/controllers/main/service/reassign_controller.js
index 3bb1c05..1f97a50 100644
--- a/ambari-web/app/controllers/main/service/reassign_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign_controller.js
@@ -144,15 +144,14 @@ App.ReassignMasterController = App.WizardController.extend({
         type: 'sync',
         callback: function () {
           this.loadComponentDir();
-          this.updateUserConfigs();
         }
       }
     ]
   },
 
   serviceToConfigSiteMap: {
-    'NAMENODE': ['hdfs-site', 'core-site', 'hadoop-env', 'cluster-env'],
-    'SECONDARY_NAMENODE': ['hdfs-site', 'core-site', 'hadoop-env', 'cluster-env'],
+    'NAMENODE': ['hdfs-site', 'core-site'],
+    'SECONDARY_NAMENODE': ['hdfs-site', 'core-site'],
     'JOBTRACKER': ['mapred-site'],
     'RESOURCEMANAGER': ['yarn-site'],
     'WEBHCAT_SERVER': ['hive-env', 'webhcat-site', 'core-site'],
@@ -202,14 +201,6 @@ App.ReassignMasterController = App.WizardController.extend({
     var statuses = App.db.getReassignTasksStatuses();
     this.set('content.tasksStatuses', statuses);
   },
-  
-  /**
-   * Update hdfs-user and group with actual value from configs
-   */
-  updateUserConfigs: function() {
-    this.set('content.hdfsUser', this.get('content.configs')['hadoop-env']['hdfs_user']);
-    this.set('content.group', this.get('content.configs')['cluster-env']['user_group']);
-  },
 
   /**
    * save status of the cluster.
diff --git a/ambari-web/test/controllers/main/service/reassign_controller_test.js b/ambari-web/test/controllers/main/service/reassign_controller_test.js
index f2db228..ed9a861 100644
--- a/ambari-web/test/controllers/main/service/reassign_controller_test.js
+++ b/ambari-web/test/controllers/main/service/reassign_controller_test.js
@@ -130,23 +130,5 @@ describe('App.ReassignMasterController', function () {
     });
 
   });
-  
-  describe('#updateUserConfigs', function() {
-    
-    it('should update user and group from configs', function() {
-      reassignMasterController.set('content.configs', {
-        'hadoop-env': {
-          'hdfs_user': 'u1'
-        },
-        'cluster-env': {
-          'user_group': 'g1'
-        }
-      });
-      reassignMasterController.updateUserConfigs();
-      expect(reassignMasterController.get('content.hdfsUser')).to.be.equal('u1');
-      expect(reassignMasterController.get('content.group')).to.be.equal('g1');
-      
-    });
-  });
 
 });