Repository: ambari Updated Branches: refs/heads/branch-2.5 a43407b9c -> 61f667b1f
AMBARI-20608. ambari setup incorrect link on mysql jdbc connector.(vbrodetskyi) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/61f667b1 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/61f667b1 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/61f667b1 Branch: refs/heads/branch-2.5 Commit: 61f667b1f81c6f04f91ebb2c5b8f4cc73be50b8c Parents: a43407b Author: Vitaly Brodetskyi <[email protected]> Authored: Thu Mar 30 20:34:05 2017 +0300 Committer: Vitaly Brodetskyi <[email protected]> Committed: Thu Mar 30 20:34:05 2017 +0300 ---------------------------------------------------------------------- .../src/main/python/ambari_server/dbConfiguration.py | 4 +--- ambari-server/src/test/python/TestAmbariServer.py | 15 ++------------- 2 files changed, 3 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/61f667b1/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 ede257f..4cfd2c1 100644 --- a/ambari-server/src/main/python/ambari_server/dbConfiguration.py +++ b/ambari-server/src/main/python/ambari_server/dbConfiguration.py @@ -165,9 +165,7 @@ class DBMSConfig(object): print_error_msg(msg) raise FatalException(-1, msg) - if result != 1: - result = self._install_jdbc_driver(properties, result) - return cbool(result) + return True def change_db_files_owner(self): if self._is_local_database(): http://git-wip-us.apache.org/repos/asf/ambari/blob/61f667b1/ambari-server/src/test/python/TestAmbariServer.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/TestAmbariServer.py b/ambari-server/src/test/python/TestAmbariServer.py index 529c0d8..6bf5e43 100644 --- a/ambari-server/src/test/python/TestAmbariServer.py +++ b/ambari-server/src/test/python/TestAmbariServer.py @@ -6451,9 +6451,7 @@ class TestAmbariServer(TestCase): @patch("os.path.isdir") @patch("os.path.lexists") @patch("os.remove") - @patch("os.symlink") - @patch("shutil.copy") - def test_ensure_jdbc_drivers_installed(self, shutil_copy_mock, os_symlink_mock, os_remove_mock, lexists_mock, isdir_mock, glob_mock, + def test_ensure_jdbc_drivers_installed(self, os_remove_mock, lexists_mock, isdir_mock, glob_mock, raw_input_mock, print_warning_msg, print_error_msg_mock, print_error_msg_2_mock, get_ambari_properties_mock, get_ambari_properties_2_mock): out = StringIO.StringIO() @@ -6462,7 +6460,6 @@ class TestAmbariServer(TestCase): def reset_mocks(): get_ambari_properties_mock.reset_mock() get_ambari_properties_2_mock.reset_mock() - shutil_copy_mock.reset_mock() print_error_msg_mock.reset_mock() print_warning_msg.reset_mock() raw_input_mock.reset_mock() @@ -6498,13 +6495,7 @@ class TestAmbariServer(TestCase): dbms = factory.create(args, props) rcode = dbms.ensure_jdbc_driver_installed(props) - self.assertEquals(os_symlink_mock.call_count, 1) - self.assertEquals(os_symlink_mock.call_args_list[0][0][0], os.path.join(os.sep,'tmp','ojdbc6.jar')) - self.assertEquals(os_symlink_mock.call_args_list[0][0][1], os.path.join(os.sep,'tmp','oracle-jdbc-driver.jar')) self.assertTrue(rcode) - self.assertEquals(shutil_copy_mock.call_count, 1) - self.assertEquals(shutil_copy_mock.call_args_list[0][0][0], drivers_list[0]) - self.assertEquals(shutil_copy_mock.call_args_list[0][0][1], resources_dir) # Check negative scenarios # Silent option, no drivers @@ -6550,9 +6541,7 @@ class TestAmbariServer(TestCase): rcode = dbms.ensure_jdbc_driver_installed(props) self.assertTrue(rcode) - self.assertEquals(shutil_copy_mock.call_count, 1) - self.assertEquals(shutil_copy_mock.call_args_list[0][0][0], drivers_list[0]) - self.assertEquals(shutil_copy_mock.call_args_list[0][0][1], resources_dir) + # Non-Silent option, no drivers at first ask, no drivers after that args = reset_mocks()
