You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by mp...@apache.org on 2018/03/19 16:41:09 UTC

[ambari] branch trunk updated: AMBARI-23247. Ambari Setup with external postgres db failed on configuring database. (mpapirkovskyy)

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

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


The following commit(s) were added to refs/heads/trunk by this push:
     new 702b5b6  AMBARI-23247. Ambari Setup with external postgres db failed on configuring database. (mpapirkovskyy)
702b5b6 is described below

commit 702b5b6b10c70516d1f51da0c4cdb44f68991a45
Author: Myroslav Papirkovskyi <mp...@apache.org>
AuthorDate: Thu Mar 15 17:44:16 2018 +0200

    AMBARI-23247. Ambari Setup with external postgres db failed on configuring database. (mpapirkovskyy)
---
 ambari-server/src/main/python/ambari_server/dbConfiguration.py | 10 ++++++++++
 .../src/main/python/ambari_server/dbConfiguration_linux.py     |  3 +++
 2 files changed, 13 insertions(+)

diff --git a/ambari-server/src/main/python/ambari_server/dbConfiguration.py b/ambari-server/src/main/python/ambari_server/dbConfiguration.py
index 1d54dce..c9e1afc 100644
--- a/ambari-server/src/main/python/ambari_server/dbConfiguration.py
+++ b/ambari-server/src/main/python/ambari_server/dbConfiguration.py
@@ -162,10 +162,17 @@ class DBMSConfig(object):
     pass
 
   def ensure_jdbc_driver_installed(self, properties):
+    # check default driver is already in classpath, will be passed for postgres only, because its driver is built-in
+    is_driver_in_classpath = self._is_jdbc_driver_installed(properties)
+    if is_driver_in_classpath == 0:
+      return True
+
+    # check driver is available via driver path property
     server_jdbc_path = properties.get_property(JDBC_DRIVER_PATH_PROPERTY)
     if server_jdbc_path and os.path.isfile(server_jdbc_path):
       return True
 
+    # check driver is present by default driver path
     default_driver_path = self._get_default_driver_path(properties)
     if default_driver_path and os.path.isfile(default_driver_path):
       ambari_should_use_existing_default_jdbc = get_YN_input("Should ambari use existing default jdbc {0} [y/n] (y)? ".format(default_driver_path), True)
@@ -174,6 +181,9 @@ class DBMSConfig(object):
         update_properties(properties)
         return True
 
+    if get_silent():
+      print_error_msg(self.JDBC_DRIVER_INSTALL_MSG)
+      return False
     path_to_custom_jdbc_driver = get_validated_string_input("Enter full path to custom jdbc driver: ", None, None, None, False, False)
     if path_to_custom_jdbc_driver and os.path.isfile(path_to_custom_jdbc_driver):
       try:
diff --git a/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py b/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
index 0d31fac..e1d31e4 100644
--- a/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
+++ b/ambari-server/src/main/python/ambari_server/dbConfiguration_linux.py
@@ -168,6 +168,9 @@ class LinuxDBMSConfig(DBMSConfig):
       if not retcode == 0:
         err = 'Error while configuring connection properties. Exiting'
         raise FatalException(retcode, err)
+    else:
+      err = 'Error while configuring connection properties. Exiting'
+      raise FatalException(-1, err)
 
   def _reset_remote_database(self):
     client_usage_cmd_drop = self._get_remote_script_line(self.drop_tables_script_file)

-- 
To stop receiving notification emails like this one, please contact
mpapirkovskyy@apache.org.