You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by od...@apache.org on 2015/12/08 03:04:18 UTC

ambari git commit: AMBARI-14208. Update hawq_dfs_url with nameservice when hawq is installed on a ha cluster( Bhuvnesh Chaudhary via odiachenko).

Repository: ambari
Updated Branches:
  refs/heads/trunk 53fb588f2 -> 858d3fc11


AMBARI-14208. Update hawq_dfs_url with nameservice when hawq is installed on a ha cluster( Bhuvnesh Chaudhary via odiachenko).


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

Branch: refs/heads/trunk
Commit: 858d3fc11b0f0c5cd93617a409b8613bd78f3803
Parents: 53fb588
Author: Oleksandr Diachenko <od...@pivotal.io>
Authored: Mon Dec 7 18:04:03 2015 -0800
Committer: Oleksandr Diachenko <od...@pivotal.io>
Committed: Mon Dec 7 18:04:03 2015 -0800

----------------------------------------------------------------------
 .../app/controllers/wizard/step7_controller.js     | 17 ++++++++++++++---
 ambari-web/test/controllers/wizard/step7_test.js   |  6 ++++++
 2 files changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/858d3fc1/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js
index c9d3da7..c64a039 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -915,12 +915,23 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
       {
         serviceName: 'ACCUMULO',
         configToUpdate: 'instance.volumes'
+      },
+      {
+        serviceName: 'HAWQ',
+        configToUpdate: 'hawq_dfs_url',
+        regexPattern: /(^.*:[0-9]+)(?=\/)/,
+        replacementValue: nameServiceId.get('value')
       }
     ]).forEach(function (c) {
       if (selectedServiceNames.contains(c.serviceName) && nameServiceId) {
-        var cfg = serviceConfigs.findProperty('serviceName', c.serviceName).configs.findProperty('name', c.configToUpdate),
-          newValue = cfg.get('value').replace(/\/\/.*:[0-9]+/i, '//' + nameServiceId.get('value'));
-
+        var cfg = serviceConfigs.findProperty('serviceName', c.serviceName).configs.findProperty('name', c.configToUpdate);
+        var regexPattern = /\/\/.*:[0-9]+/i;
+        var replacementValue = '//' + nameServiceId.get('value');
+        if (typeof(c.regexPattern) !== "undefined" && typeof(c.replacementValue) !== "undefined") {
+          regexPattern = c.regexPattern;
+          replacementValue = c.replacementValue;
+        }
+        var newValue = cfg.get('value').replace(regexPattern, replacementValue);
         cfg.setProperties({
           value: newValue,
           recommendedValue: newValue

http://git-wip-us.apache.org/repos/asf/ambari/blob/858d3fc1/ambari-web/test/controllers/wizard/step7_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step7_test.js b/ambari-web/test/controllers/wizard/step7_test.js
index bba552a..e904a48 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -1608,6 +1608,12 @@ describe('App.InstallerStep7Controller', function () {
         configToUpdate: 'instance.volumes',
         oldValue: 'hdfs://localhost:8020/apps/accumulo/data',
         expectedNewValue: 'hdfs://' + dfsNameservices + '/apps/accumulo/data'
+      },
+      {
+        serviceName: 'HAWQ',
+        configToUpdate: 'hawq_dfs_url',
+        oldValue: 'localhost:8020/hawq_data',
+        expectedNewValue: dfsNameservices + '/hawq_data'
       }
     ]).forEach(function (test) {
       it(test.serviceName + ' ' + test.configToUpdate, function () {