ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [1/2] ambari git commit: AMBARI-14125. DB Admin Test connection from ambari screen does not work for Oracle DB 'SYS' user (aonishuk)
Date Tue, 01 Dec 2015 11:21:21 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 8472ec571 -> 9403dfa93
  refs/heads/trunk 2d8f69e75 -> 95a71a68f


AMBARI-14125. DB Admin Test connection from ambari screen does not work for Oracle DB 'SYS'
user (aonishuk)


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

Branch: refs/heads/trunk
Commit: 95a71a68f6f8d9ad3df1a573262f330d65a45111
Parents: 2d8f69e
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Tue Dec 1 13:21:02 2015 +0200
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Tue Dec 1 13:21:02 2015 +0200

----------------------------------------------------------------------
 .../src/main/resources/custom_actions/scripts/check_host.py     | 5 ++++-
 ambari-server/src/test/python/custom_actions/TestCheckHost.py   | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/95a71a68/ambari-server/src/main/resources/custom_actions/scripts/check_host.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/custom_actions/scripts/check_host.py b/ambari-server/src/main/resources/custom_actions/scripts/check_host.py
index 01d79fe..47bceec 100644
--- a/ambari-server/src/main/resources/custom_actions/scripts/check_host.py
+++ b/ambari-server/src/main/resources/custom_actions/scripts/check_host.py
@@ -377,11 +377,14 @@ class CheckHost(Script):
       db_connection_check_structured_output = {"exit_code" : 1, "message": message}
       return db_connection_check_structured_output
 
+    # For Oracle connection as SYS should be as SYSDBA
+    if db_name == DB_ORACLE and user_name.upper() == "SYS":
+      user_name = "SYS AS SYSDBA"
 
     # try to connect to db
     db_connection_check_command = format("{java_exec} -cp {check_db_connection_path}{class_path_delimiter}"
\
            "{jdbc_jar_path} -Djava.library.path={java_library_path} org.apache.ambari.server.DBConnectionVerification
\"{db_connection_url}\" " \
-           "{user_name} {user_passwd!p} {jdbc_driver_class}")
+           "\"{user_name}\" {user_passwd!p} {jdbc_driver_class}")
 
     if db_name == DB_SQLA:
       db_connection_check_command = "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{0}{1} {2}".format(agent_cache_dir,

http://git-wip-us.apache.org/repos/asf/ambari/blob/95a71a68/ambari-server/src/test/python/custom_actions/TestCheckHost.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/custom_actions/TestCheckHost.py b/ambari-server/src/test/python/custom_actions/TestCheckHost.py
index 1e45927..ec9c681 100644
--- a/ambari-server/src/test/python/custom_actions/TestCheckHost.py
+++ b/ambari-server/src/test/python/custom_actions/TestCheckHost.py
@@ -142,7 +142,7 @@ class TestCheckHost(TestCase):
                                                                                     'exit_code':
1}})
     self.assertEquals(format_mock.call_args[0][0],'{java_exec} -cp {check_db_connection_path}{class_path_delimiter}'
             '{jdbc_jar_path} -Djava.library.path={java_library_path} org.apache.ambari.server.DBConnectionVerification'
-            ' "{db_connection_url}" {user_name} {user_passwd!p} {jdbc_driver_class}')
+            ' "{db_connection_url}" "{user_name}" {user_passwd!p} {jdbc_driver_class}')
 
     # test, db connection success
     download_file_mock.reset_mock()


Mime
View raw message