You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2018/06/20 19:33:47 UTC

[ambari] branch trunk updated (6cef8cb -> 804bfa0)

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

yusaku pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git.


    from 6cef8cb  AMBARI-24155 Ranger and KMS tab still present in Customize ServicesPage even after going back and deselecting them from Choose ServicesPage. (ababiichuk)
     new 7aba3bf  AMBARI-24154. DB Connectivity Warnings for oozie & hive show up even after tests are passed
     new 804bfa0  AMBARI-24154. DB Connectivity Warnings for oozie & hive show up even after tests are passed (review)

The 2 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.


Summary of changes:
 .../widgets/test_db_connection_widget_view.js      | 47 ++++++++++++++++++++++
 1 file changed, 47 insertions(+)


[ambari] 01/02: AMBARI-24154. DB Connectivity Warnings for oozie & hive show up even after tests are passed

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

yusaku pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git

commit 7aba3bfb3ad67a85a6b35a8145fb437d0f8cebbd
Author: Alex Antonenko <aa...@hortonworks.com>
AuthorDate: Wed Jun 20 16:22:56 2018 +0300

    AMBARI-24154. DB Connectivity Warnings for oozie & hive show up even after tests are passed
---
 .../widgets/test_db_connection_widget_view.js      | 47 ++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js b/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js
index 98516ff..987e069 100644
--- a/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js
+++ b/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js
@@ -187,6 +187,7 @@ App.TestDbConnectionWidgetView = App.ConfigWidgetView.extend({
   connectToDatabase: function () {
     if (this.get('isBtnDisabled')) return;
     this.set('isRequestResolved', false);
+    App.db.set('tmp', this.get('parentView.service.serviceName') + '_connection', {});
     this.setConnectingStatus(true);
     if (App.get('testMode')) {
       this.startPolling();
@@ -274,6 +275,51 @@ App.TestDbConnectionWidgetView = App.ConfigWidgetView.extend({
     this.set('request', request);
   },
 
+  preparedDBProperties: function() {
+    var propObj = {};
+    var serviceName = this.get('config.serviceName');
+    var serviceConfigs = this.get('controller.stepConfigs').findProperty('serviceName',serviceName).get('configs');
+    for (var key in this.get('propertiesPattern')) {
+      var propName = this.getConnectionProperty(this.get('propertiesPattern')[key], true);
+      propObj[propName] = serviceConfigs.findProperty('name', propName).get('value');
+    }
+    return propObj;
+  }.property(),
+
+  requiredProps: function() {
+    var ranger = App.StackService.find().findProperty('serviceName', 'RANGER');
+    var propertiesMap = {
+      OOZIE: ['oozie.db.schema.name', 'oozie.service.JPAService.jdbc.username', 'oozie.service.JPAService.jdbc.password', 'oozie.service.JPAService.jdbc.driver', 'oozie.service.JPAService.jdbc.url'],
+      HIVE: ['ambari.hive.db.schema.name', 'javax.jdo.option.ConnectionUserName', 'javax.jdo.option.ConnectionPassword', 'javax.jdo.option.ConnectionDriverName', 'javax.jdo.option.ConnectionURL'],
+      KERBEROS: ['kdc_hosts'],
+      RANGER: ranger && App.StackService.find().findProperty('serviceName', 'RANGER').compareCurrentVersion('0.5') > -1 ?
+        ['db_user', 'db_password', 'db_name', 'ranger.jpa.jdbc.url', 'ranger.jpa.jdbc.driver'] :
+        ['db_user', 'db_password', 'db_name', 'ranger_jdbc_connection_url', 'ranger_jdbc_driver']
+    };
+    return propertiesMap[this.get('parentView.service.serviceName')];
+  }.property(),
+
+  getConnectionProperty: function (regexp, isGetName) {
+    var _this = this;
+    var serviceName = this.get('config.serviceName');
+    var serviceConfigs = this.get('controller.stepConfigs').findProperty('serviceName',serviceName).get('configs');
+    var propertyName = _this.get('requiredProps').filter(function (item) {
+      return regexp.test(item);
+    })[0];
+    return (isGetName) ? propertyName : serviceConfigs.findProperty('name', propertyName).get('value');
+  },
+
+  propertiesPattern: function() {
+    var patterns = {
+      db_connection_url: /jdbc\.url|connection_url|connectionurl|kdc_hosts/ig
+    };
+    if (this.get('parentView.service.serviceName') != "KERBEROS") {
+      patterns.user_name = /(username|dblogin|db_user)$/ig;
+      patterns.user_passwd = /(dbpassword|password|db_password)$/ig;
+    }
+    return patterns;
+  }.property('parentView.service.serviceName'),
+
   getTaskInfoSuccess: function (data) {
     var task = data.Tasks;
     this.set('responseFromServer', {
@@ -290,6 +336,7 @@ App.TestDbConnectionWidgetView = App.ConfigWidgetView.extend({
         });
         this.setResponseStatus('failed');
       } else {
+        App.db.set('tmp', this.get('parentView.service.serviceName') + '_connection', this.get('preparedDBProperties'));
         this.setResponseStatus('success');
       }
     }


[ambari] 02/02: AMBARI-24154. DB Connectivity Warnings for oozie & hive show up even after tests are passed (review)

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

yusaku pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git

commit 804bfa0ed580e7447d922f69d4a0d5d729f2ef8b
Author: Alex Antonenko <aa...@hortonworks.com>
AuthorDate: Wed Jun 20 16:48:27 2018 +0300

    AMBARI-24154. DB Connectivity Warnings for oozie & hive show up even after tests are passed (review)
---
 .../views/common/configs/widgets/test_db_connection_widget_view.js  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js b/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js
index 987e069..ba3764f 100644
--- a/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js
+++ b/ambari-web/app/views/common/configs/widgets/test_db_connection_widget_view.js
@@ -21,6 +21,7 @@ require('views/common/controls_view');
 var App = require('app');
 var dbUtils = require('utils/configs/database');
 
+//@Todo merge with CheckDBConnectionView
 App.TestDbConnectionWidgetView = App.ConfigWidgetView.extend({
   templateName: require('templates/common/configs/widgets/test_db_connection_widget'),
   classNames: ['widget'],
@@ -292,7 +293,7 @@ App.TestDbConnectionWidgetView = App.ConfigWidgetView.extend({
       OOZIE: ['oozie.db.schema.name', 'oozie.service.JPAService.jdbc.username', 'oozie.service.JPAService.jdbc.password', 'oozie.service.JPAService.jdbc.driver', 'oozie.service.JPAService.jdbc.url'],
       HIVE: ['ambari.hive.db.schema.name', 'javax.jdo.option.ConnectionUserName', 'javax.jdo.option.ConnectionPassword', 'javax.jdo.option.ConnectionDriverName', 'javax.jdo.option.ConnectionURL'],
       KERBEROS: ['kdc_hosts'],
-      RANGER: ranger && App.StackService.find().findProperty('serviceName', 'RANGER').compareCurrentVersion('0.5') > -1 ?
+      RANGER: ranger && ranger.compareCurrentVersion('0.5') > -1 ?
         ['db_user', 'db_password', 'db_name', 'ranger.jpa.jdbc.url', 'ranger.jpa.jdbc.driver'] :
         ['db_user', 'db_password', 'db_name', 'ranger_jdbc_connection_url', 'ranger_jdbc_driver']
     };
@@ -300,10 +301,9 @@ App.TestDbConnectionWidgetView = App.ConfigWidgetView.extend({
   }.property(),
 
   getConnectionProperty: function (regexp, isGetName) {
-    var _this = this;
     var serviceName = this.get('config.serviceName');
     var serviceConfigs = this.get('controller.stepConfigs').findProperty('serviceName',serviceName).get('configs');
-    var propertyName = _this.get('requiredProps').filter(function (item) {
+    var propertyName = this.get('requiredProps').filter(function (item) {
       return regexp.test(item);
     })[0];
     return (isGetName) ? propertyName : serviceConfigs.findProperty('name', propertyName).get('value');