Repository: ambari Updated Branches: refs/heads/trunk 6492d0ec4 -> 901b59ce4
AMBARI-6111. Change dbconnection test connection failure message to be more explicit.(vbrodetskyi) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/901b59ce Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/901b59ce Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/901b59ce Branch: refs/heads/trunk Commit: 901b59ce460da69ad2ecd50b0b8f24b140e8dfaa Parents: 6492d0e Author: Vitaly Brodetskyi <vbrodets...@hortonworks.com> Authored: Fri Jun 13 04:46:20 2014 +0300 Committer: Vitaly Brodetskyi <vbrodets...@hortonworks.com> Committed: Fri Jun 13 04:46:33 2014 +0300 ---------------------------------------------------------------------- .../src/main/resources/custom_actions/check_host.py | 7 ++++--- ambari-server/src/test/python/TestCheckHost.py | 11 ++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/901b59ce/ambari-server/src/main/resources/custom_actions/check_host.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/custom_actions/check_host.py b/ambari-server/src/main/resources/custom_actions/check_host.py index 7128196..c88b04d 100644 --- a/ambari-server/src/main/resources/custom_actions/check_host.py +++ b/ambari-server/src/main/resources/custom_actions/check_host.py @@ -188,9 +188,10 @@ class CheckHost(Script): "--retry 5 {jdbc_url} -o {jdbc_name}'") Execute(cmd, not_if=format("[ -f /usr/lib/ambari-agent/{jdbc_name}]"), environment = environment) except Exception, e: - message = "Error downloading JDBC connector from Ambari Server resources. Confirm you ran ambari-server setup to " \ - "install JDBC connector. Use \"ambari-server setup --help\" for more information. Check network access to " \ - "Ambari Server.\n" + str(e) + message = format("Error: Ambari Server cannot download the database JDBC driver and is unable to test the " \ + "database connection. You must run ambari-server setup --jdbc-db={db_name} " \ + "--jdbc-driver=/path/to/your/{db_name}/driver.jar on the Ambari Server host to make the JDBC " \ + "driver available for download and to enable testing the database connection.\n") + str(e) print message db_connection_check_structured_output = {"exit_code" : 1, "message": message} return db_connection_check_structured_output http://git-wip-us.apache.org/repos/asf/ambari/blob/901b59ce/ambari-server/src/test/python/TestCheckHost.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/TestCheckHost.py b/ambari-server/src/test/python/TestCheckHost.py index d84ead4..bf4281a 100644 --- a/ambari-server/src/test/python/TestCheckHost.py +++ b/ambari-server/src/test/python/TestCheckHost.py @@ -105,11 +105,12 @@ class TestCheckHost(TestCase): checkHost.actionexecute(None) - self.assertEquals(structured_out_mock.call_args[0][0], {'db_connection_check': {'message': 'Error downloading JDBC ' \ - 'connector from Ambari Server resources. Confirm you ran ambari-server setup to ' \ - 'install JDBC connector. Use "ambari-server setup --help" for more information. Check ' \ - 'network access to Ambari Server.\ntest exception', 'exit_code': 1}}) - + self.assertEquals(format_mock.call_args[0][0], 'Error: Ambari Server cannot download the database JDBC driver ' + 'and is unable to test the database connection. You must run ambari-server setup ' + '--jdbc-db={db_name} --jdbc-driver=/path/to/your/{db_name}/driver.jar on the Ambari ' + 'Server host to make the JDBC driver available for download and to enable testing ' + 'the database connection.\n') + self.assertEquals(structured_out_mock.call_args[0][0]['db_connection_check']['exit_code'], 1) self.assertEquals(format_mock.call_args_list[4][0][0], "/bin/sh -c 'cd /usr/lib/ambari-agent/ && curl -kf " \ "--retry 5 {jdbc_url} -o {jdbc_name}'")