Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 d1c068e3f -> 74eb8d1de


AMBARI-13656 oozie service check failing after reassigning host with custom 
service user. (ababiichuk)


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

Branch: refs/heads/branch-2.1
Commit: 74eb8d1de9114adea154bdcc7ec9e85d1b299444
Parents: d1c068e
Author: aBabiichuk <[email protected]>
Authored: Fri Oct 30 15:01:23 2015 +0200
Committer: aBabiichuk <[email protected]>
Committed: Fri Oct 30 15:04:26 2015 +0200

----------------------------------------------------------------------
 .../main/service/reassign/step4_controller.js   | 38 ++++++++++++++------
 .../service/reassign/step4_controller_test.js   |  4 ++-
 .../main/service/reassign_controller_test.js    |  1 +
 3 files changed, 32 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/74eb8d1d/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 dffdf9e..f197d84 100644
--- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
@@ -543,6 +543,7 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
       case 'OOZIE_SERVER':
         urlParams.push('(type=oozie-site&tag=' + 
data.Clusters.desired_configs['oozie-site'].tag + ')');
         urlParams.push('(type=core-site&tag=' + 
data.Clusters.desired_configs['core-site'].tag + ')');
+        urlParams.push('(type=oozie-env&tag=' + 
data.Clusters.desired_configs['oozie-env'].tag + ')');
         break;
       case 'HIVE_SERVER':
       case 'HIVE_METASTORE':
@@ -585,16 +586,19 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
     this.setAdditionalConfigs(configs, componentName, targetHostName);
     this.setSecureConfigs(secureConfigs, configs, componentName);
 
-    if (componentName === 'NAMENODE') {
-      this.setSpecificNamenodeConfigs(configs, targetHostName);
-    }
-
-    if (componentName === 'RESOURCEMANAGER') {
-      this.setSpecificResourceMangerConfigs(configs, targetHostName);
-    }
-
-    if (componentName === 'HIVE_METASTORE' || componentName === 'HIVE_SERVER') 
{
-      this.setSpecificHiveConfigs(configs, targetHostName);
+    switch (componentName) {
+      case 'NAMENODE':
+        this.setSpecificNamenodeConfigs(configs, targetHostName);
+        break;
+      case 'RESOURCEMANAGER':
+        this.setSpecificResourceMangerConfigs(configs, targetHostName);
+        break;
+      case 'HIVE_METASTORE':
+      case 'HIVE_SERVER':
+        this.setSpecificHiveConfigs(configs, targetHostName);
+        break;
+      case 'OOZIE_SERVER':
+        this.setSpecificOozieConfigs(configs, targetHostName);
     }
 
     this.saveClusterStatus(secureConfigs, this.getComponentDir(configs, 
componentName));
@@ -742,6 +746,20 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
   },
 
   /**
+   * set specific configs which applies only to Oozie related configs
+   * @param configs
+   * @param targetHostName
+   */
+  setSpecificOozieConfigs: function (configs, targetHostName) {
+    var sourceHostName = this.get('content.reassignHosts.source'),
+      oozieServerHosts = 
App.HostComponent.find().filterProperty('componentName', 'OOZIE_SERVER')
+        
.mapProperty('hostName').removeObject(sourceHostName).addObject(targetHostName).uniq().join(','),
+      oozieUser = configs['oozie-env']['oozie_user'];
+
+    configs['core-site']['hadoop.proxyuser.' + oozieUser + '.hosts'] = 
oozieServerHosts;
+  },
+
+  /**
    * set specific configs which applies only to Hive related configs
    * @param configs
    * @param targetHostName

http://git-wip-us.apache.org/repos/asf/ambari/blob/74eb8d1d/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 7a7b576..f0e845c 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
@@ -490,7 +490,8 @@ describe('App.ReassignMasterWizardStep4Controller', 
function () {
         componentName: 'OOZIE_SERVER',
         result: [
           "(type=oozie-site&tag=6)",
-          "(type=core-site&tag=2)"
+          "(type=core-site&tag=2)",
+          "(type=oozie-env&tag=2)"
         ]
       },
       {
@@ -510,6 +511,7 @@ describe('App.ReassignMasterWizardStep4Controller', 
function () {
           'mapred-site': {tag: 4},
           'yarn-site': {tag: 5},
           'oozie-site': {tag: 6},
+          'oozie-env': {tag: 2},
           'webhcat-site': {tag: 7},
           'yarn-env': {tag: 8},
           'accumulo-site': {tag: 9}

http://git-wip-us.apache.org/repos/asf/ambari/blob/74eb8d1d/ambari-web/test/controllers/main/service/reassign_controller_test.js
----------------------------------------------------------------------
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 1745723..0848938 100644
--- a/ambari-web/test/controllers/main/service/reassign_controller_test.js
+++ b/ambari-web/test/controllers/main/service/reassign_controller_test.js
@@ -54,6 +54,7 @@ describe('App.ReassignMasterController', function () {
       it('check ' + c.componentName, function () {
         reassignMasterController.set('content.reassign', {'component_name': 
c.componentName});
         expect(reassignMasterController.get('totalSteps')).to.equal(c.result);
+        reassignMasterController.set('content.reassign', {service_id:null});
       });
     });
   });

Reply via email to