Repository: ambari Updated Branches: refs/heads/trunk 8b60e7a11 -> 31bbefadf
AMBARI-6020. Check database connection: host name location of master component should be passed as parameter for custom action. (Buzhor Denys via alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/31bbefad Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/31bbefad Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/31bbefad Branch: refs/heads/trunk Commit: 31bbefadfec3141d6edda3cb59deb50d183b2c98 Parents: 8b60e7a Author: Alex Antonenko <[email protected]> Authored: Wed Jun 4 18:19:15 2014 +0300 Committer: Alex Antonenko <[email protected]> Committed: Wed Jun 4 18:19:15 2014 +0300 ---------------------------------------------------------------------- ambari-web/app/views/wizard/controls_view.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/31bbefad/ambari-web/app/views/wizard/controls_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/wizard/controls_view.js b/ambari-web/app/views/wizard/controls_view.js index a0dd176..eb327cb 100644 --- a/ambari-web/app/views/wizard/controls_view.js +++ b/ambari-web/app/views/wizard/controls_view.js @@ -735,6 +735,14 @@ App.CheckDBConnectionView = Ember.View.extend({ db_connection_url: /jdbc\.url|connectionurl/ig } }.property(), + /** @property {String} masterHostName - host name location of Master Component related to Service **/ + masterHostName: function() { + var serviceMasterMap = { + 'OOZIE': 'oozieserver_host', + 'HIVE': 'hivemetastore_host' + }; + return this.get('parentView.categoryConfigsAll').findProperty('name', serviceMasterMap[this.get('parentView.service.serviceName')]).get('value'); + }.property(), /** @property {Object} connectionProperties - service specific config values mapped for custom action request **/ connectionProperties: function() { var propObj = {}; @@ -848,7 +856,6 @@ App.CheckDBConnectionView = Ember.View.extend({ * @method createCustomAction **/ createCustomAction: function() { - var databaseHost = this.get('parentView.categoryConfigsAll').findProperty('name', this.get('hostNameProperty')).get('value'); var params = $.extend(true, {}, { db_name: this.get('databaseName').toLowerCase() }, this.get('connectionProperties'), this.get('ambariProperties')); App.ajax.send({ name: 'custom_action.create', @@ -857,7 +864,7 @@ App.CheckDBConnectionView = Ember.View.extend({ requestInfo: { parameters: params }, - filteredHosts: [databaseHost] + filteredHosts: [this.get('masterHostName')] }, success: 'onCreateActionSuccess', error: 'onCreateActionError'
