You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2015/08/21 14:50:24 UTC

ambari git commit: AMBARI-12849 SQLA: UI should fix db_name for check_host custom action. (ababiichuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk 762f7d9e4 -> 00ba98448


AMBARI-12849 SQLA: UI should fix db_name for check_host custom action. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: 00ba98448bccdf8814b87aad4f353242f51a3dd9
Parents: 762f7d9
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Fri Aug 21 15:46:54 2015 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Fri Aug 21 15:50:09 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/data/HDP2/site_properties.js  | 4 ++--
 ambari-web/app/data/db_properties_info.js    | 2 +-
 ambari-web/app/utils/configs/database.js     | 5 +++--
 ambari-web/app/views/common/controls_view.js | 5 ++---
 4 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/00ba9844/ambari-web/app/data/HDP2/site_properties.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/HDP2/site_properties.js b/ambari-web/app/data/HDP2/site_properties.js
index 060e3b5..11ea3b7 100644
--- a/ambari-web/app/data/HDP2/site_properties.js
+++ b/ambari-web/app/data/HDP2/site_properties.js
@@ -3393,7 +3393,7 @@ var hdp2properties = [
       },
       {
         displayName: 'Existing SQLA Database',
-        hidden: false
+        hidden: !App.get('isHadoop23Stack')
       }
     ],
     "description": "MySQL will be installed by Ambari",
@@ -3636,7 +3636,7 @@ var hdp2properties = [
       },
       {
         displayName: 'Existing SQLA Database',
-        hidden: false
+        hidden: !App.get('isHadoop23Stack')
       }
     ],
     "description": "Current Derby Database will be installed by Ambari",

http://git-wip-us.apache.org/repos/asf/ambari/blob/00ba9844/ambari-web/app/data/db_properties_info.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/data/db_properties_info.js b/ambari-web/app/data/db_properties_info.js
index 7906648..360204c 100644
--- a/ambari-web/app/data/db_properties_info.js
+++ b/ambari-web/app/data/db_properties_info.js
@@ -109,7 +109,7 @@ module.exports = {
       'db_type': 'mssql'
     },
     'SQLA': {
-      'connection_url': 'jdbc:sqlanywhere:uid={2};pwd={3};database={1};host={0}',
+      'connection_url': 'jdbc:sqlanywhere:host={0};database={1};uid={2};pwd={3}',
       'driver': 'sap.jdbc4.sqlanywhere.IDriver',
       'sql_jar_connector': '/path_to_driver/sqla-client-jdbc.tar.gz',
       'db_type': 'sqlanywhere'

http://git-wip-us.apache.org/repos/asf/ambari/blob/00ba9844/ambari-web/app/utils/configs/database.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/configs/database.js b/ambari-web/app/utils/configs/database.js
index 3ef7c0a..74ff642 100644
--- a/ambari-web/app/utils/configs/database.js
+++ b/ambari-web/app/utils/configs/database.js
@@ -60,7 +60,8 @@ module.exports = {
     mssql: 'jdbc:sqlserver://{0};databaseName={1}',
     postgres: 'jdbc:postgresql://{0}:5432/{1}',
     derby: 'jdbc:derby:{0}/{1}',
-    oracle: 'jdbc:oracle:thin:@(?:\/?\/?){0}:1521(\:|\/){1}'
+    oracle: 'jdbc:oracle:thin:@(?:\/?\/?){0}:1521(\:|\/){1}',
+    sqla: 'jdbc:sqlanywhere:host={0};database={1};uid={2};pwd={3}'
   },
 
   /**
@@ -150,7 +151,7 @@ module.exports = {
   getDBLocationFromJDBC: function(jdbcUrl) {
     var self = this;
     var matches = Em.keys(this.DB_JDBC_PATTERNS).map(function(key) {
-      var reg = new RegExp(self.DB_JDBC_PATTERNS[key].format('(.*)', '(.*)'));
+      var reg = new RegExp(self.DB_JDBC_PATTERNS[key].format('(.*)', '(.*)', '(.*)', '(.*)'));
       return jdbcUrl.match(reg);
     }).compact();
     if (matches.length) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/00ba9844/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 d37b3af..a93f957 100644
--- a/ambari-web/app/views/common/controls_view.js
+++ b/ambari-web/app/views/common/controls_view.js
@@ -677,7 +677,7 @@ App.ServiceConfigRadioButtons = Ember.View.extend(App.ServiceConfigCalculateId,
     var shouldAdditionalViewsBeSet = currentDB && checkDatabase && handledProperties.contains(this.get('serviceConfig.name')),
       driver = this.getDefaultPropertyValue('sql_jar_connector') ? this.getDefaultPropertyValue('sql_jar_connector').split("/").pop() : 'driver.jar',
       dbType = this.getDefaultPropertyValue('db_type'),
-      additionalView1 = shouldAdditionalViewsBeSet ? App.CheckDBConnectionView.extend({databaseName: currentDB}) : null,
+      additionalView1 = shouldAdditionalViewsBeSet ? App.CheckDBConnectionView.extend({databaseName: dbType}) : null,
       additionalView2 = shouldAdditionalViewsBeSet ? Ember.View.extend({
         template: Ember.Handlebars.compile('<div class="alert">{{{view.message}}}</div>'),
         message: Em.I18n.t('services.service.config.database.msg.jdbcSetup').format(dbType, driver)
@@ -1321,8 +1321,7 @@ App.CheckDBConnectionView = Ember.View.extend({
    * @method createCustomAction
    **/
   createCustomAction: function() {
-    var dbName = this.get('databaseName').toLowerCase() === 'postgresql' ? 'postgres' : this.get('databaseName').toLowerCase();
-    var params = $.extend(true, {}, { db_name: dbName }, this.get('connectionProperties'), this.get('ambariProperties'));
+    var params = $.extend(true, {}, { db_name: this.get('databaseName').toLowerCase() }, this.get('connectionProperties'), this.get('ambariProperties'));
     App.ajax.send({
       name: 'custom_action.create',
       sender: this,