You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/05/05 19:21:13 UTC

ambari git commit: AMBARI-10907. Implement Database connectivity check from Ranger admin host. Additional patch (alexantonenko)

Repository: ambari
Updated Branches:
  refs/heads/trunk 172dd8cf4 -> 2fb314f7d


AMBARI-10907. Implement Database connectivity check from Ranger admin host. Additional patch (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 2fb314f7d17e3115c9e5ec7cec4c242eab0bd068
Parents: 172dd8c
Author: Alex Antonenko <hi...@gmail.com>
Authored: Tue May 5 20:19:56 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Tue May 5 20:21:09 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/utils/configs/config_property_helper.js | 12 +++++++++---
 ambari-web/app/views/common/controls_view.js           |  4 +++-
 2 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2fb314f7/ambari-web/app/utils/configs/config_property_helper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/configs/config_property_helper.js b/ambari-web/app/utils/configs/config_property_helper.js
index 07e3340..9661df3 100644
--- a/ambari-web/app/utils/configs/config_property_helper.js
+++ b/ambari-web/app/utils/configs/config_property_helper.js
@@ -318,14 +318,20 @@ module.exports = {
         break;
       case 'db_host':
       case 'rangerserver_host':
-        configProperty.set('value', masterComponentHostsInDB.findProperty('component', 'RANGER_ADMIN').hostName);
+        var masterComponent =  masterComponentHostsInDB.findProperty('component', 'RANGER_ADMIN');
+        if (masterComponent) {
+          configProperty.set('value', masterComponent.hostName);
+        };
         break;
       case 'ranger_mysql_host':
       case 'ranger_oracle_host':
       case 'ranger_postgres_host':
       case 'ranger_mssql_host':
-        var rangerServerHost = masterComponentHostsInDB.findProperty('component', 'RANGER_ADMIN').hostName;
-        configProperty.set('value', rangerServerHost).set('defaultValue', rangerServerHost);
+        var masterComponent = masterComponentHostsInDB.findProperty('component', 'RANGER_ADMIN'),
+          rangerServerHost = masterComponent ? masterComponentHostsInDB.findProperty('component', 'RANGER_ADMIN').hostName : '';
+        if (rangerServerHost) {
+          configProperty.set('value', rangerServerHost).set('defaultValue', rangerServerHost);
+        }
         break;
     }
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/2fb314f7/ambari-web/app/views/common/controls_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/controls_view.js b/ambari-web/app/views/common/controls_view.js
index 1fb4cf8..3e6c12e 100644
--- a/ambari-web/app/views/common/controls_view.js
+++ b/ambari-web/app/views/common/controls_view.js
@@ -419,7 +419,9 @@ App.ServiceConfigRadioButtons = Ember.View.extend(App.ServiceConfigCalculateId,
     // on page render, automatically populate JDBC URLs only for default database settings
     // so as to not lose the user's customizations on these fields
     if (['addServiceController', 'installerController'].contains(this.get('controller.wizardController.name'))) {
-      if (/^New\s\w+\sDatabase$/.test(this.get('serviceConfig.value')) || this.get('dontUseHandleDbConnection').contains(this.get('serviceConfig.name'))) {
+      if (/^New\s\w+\sDatabase$/.test(this.get('serviceConfig.value')) ||
+        this.get('dontUseHandleDbConnection').contains(this.get('serviceConfig.name')) ||
+        this.get('serviceConfig.serviceName') === 'RANGER') {
         this.onOptionsChange();
       } else {
         if (App.get('isHadoopWindowsStack') && /SQL\sauthentication/.test(this.get('serviceConfig.value'))) {