ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [2/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:22 GMT
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/9403dfa9
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9403dfa9
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9403dfa9

Branch: refs/heads/branch-2.1
Commit: 9403dfa93de99f89aadb3f9b157ab4ae29676791
Parents: 8472ec5
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Tue Dec 1 13:21:05 2015 +0200
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Tue Dec 1 13:21:05 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/9403dfa9/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 686aec6..a2e6652 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/9403dfa9/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 14cb8e3..c96b6e5 100644
--- a/ambari-server/src/test/python/custom_actions/TestCheckHost.py
+++ b/ambari-server/src/test/python/custom_actions/TestCheckHost.py
@@ -147,7 +147,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