You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vb...@apache.org on 2015/09/21 15:20:49 UTC

ambari git commit: AMBARI-13166. Ambari with sqla db fails to start by non root user. Problem with jdbc.(vbrodetskyi)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 3ad59b7ee -> eb9188575


AMBARI-13166. Ambari with sqla db fails to start by non root user. Problem with jdbc.(vbrodetskyi)


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

Branch: refs/heads/branch-2.1
Commit: eb9188575f81e331d20315b2fa6b5d29cfc25c62
Parents: 3ad59b7
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Mon Sep 21 16:20:22 2015 +0300
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Mon Sep 21 16:20:22 2015 +0300

----------------------------------------------------------------------
 .../src/main/python/ambari_server/dbConfiguration.py    | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/eb918857/ambari-server/src/main/python/ambari_server/dbConfiguration.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/dbConfiguration.py b/ambari-server/src/main/python/ambari_server/dbConfiguration.py
index 2d39c72..85153eb 100644
--- a/ambari-server/src/main/python/ambari_server/dbConfiguration.py
+++ b/ambari-server/src/main/python/ambari_server/dbConfiguration.py
@@ -27,7 +27,8 @@ from ambari_commons.os_family_impl import OsFamilyImpl
 from ambari_commons.str_utils import cbool
 from ambari_server.serverConfiguration import decrypt_password_for_alias, get_ambari_properties, get_is_secure, \
   get_resources_location, get_value_from_properties, is_alias_string, \
-  JDBC_PASSWORD_PROPERTY, JDBC_RCA_PASSWORD_ALIAS, PRESS_ENTER_MSG, DEFAULT_DBMS_PROPERTY
+  JDBC_PASSWORD_PROPERTY, JDBC_RCA_PASSWORD_ALIAS, PRESS_ENTER_MSG, DEFAULT_DBMS_PROPERTY, JDBC_DATABASE_PROPERTY, \
+  PERSISTENCE_TYPE_PROPERTY
 from ambari_server.userInput import get_validated_string_input
 
 
@@ -386,7 +387,14 @@ class DBMSConfigFactoryLinux(DBMSConfigFactory):
     try:
       dbms_index = options.database_index
     except AttributeError:
-      dbms_index = self._get_default_dbms_index(options)
+      db_name = get_value_from_properties(get_ambari_properties(), JDBC_DATABASE_PROPERTY, "").strip().lower()
+      persistence_type = get_value_from_properties(get_ambari_properties(), PERSISTENCE_TYPE_PROPERTY, "").strip().lower()
+      if persistence_type == STORAGE_TYPE_LOCAL:
+        dbms_index = self.DBMS_KEYS_LIST.index("embedded")
+      elif db_name:
+        dbms_index = self.DBMS_KEYS_LIST.index(db_name)
+      else:
+        dbms_index = self._get_default_dbms_index(options)
 
     if options.must_set_database_options:
       n_dbms = 1