Repository: ambari Updated Branches: refs/heads/branch-2.5 567e94be9 -> 4317a6a01
Revert "AMBARI-17889. Bad error message if user has not performed ambari-server setup for jdbc driver before configuring custom DB.(vbrodetskyi)" This reverts commit a16cb5ad98cd7146f55bd9fd8d55edd4ec0a5897. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/4317a6a0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4317a6a0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4317a6a0 Branch: refs/heads/branch-2.5 Commit: 4317a6a017fadbd25683a834efd3e82278c37890 Parents: 567e94b Author: Vitaly Brodetskyi <[email protected]> Authored: Thu Aug 25 18:41:27 2016 +0300 Committer: Vitaly Brodetskyi <[email protected]> Committed: Thu Aug 25 18:41:27 2016 +0300 ---------------------------------------------------------------------- .../custom_actions/scripts/check_host.py | 53 ++++++-------------- 1 file changed, 16 insertions(+), 37 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/4317a6a0/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 4077610..3d9dfa8 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 @@ -279,54 +279,33 @@ class CheckHost(Script): jdk_location = config['commandParams']['jdk_location'] java_home = config['commandParams']['java_home'] db_name = config['commandParams']['db_name'] - no_jdbc_error_message = None if db_name == DB_MYSQL: jdbc_driver_mysql_name = default("/hostLevelParams/custom_mysql_jdbc_name", None) - if not jdbc_driver_mysql_name: - no_jdbc_error_message = "The MySQL JDBC driver has not been set. Please ensure that you have executed 'ambari-server setup --jdbc-db=mysql --jdbc-driver=/path/to/jdbc_driver'." - else: - jdbc_url = jdk_location + jdbc_driver_mysql_name - jdbc_driver_class = JDBC_DRIVER_CLASS_MYSQL - jdbc_name = jdbc_driver_mysql_name + jdbc_url = jdk_location + jdbc_driver_mysql_name + jdbc_driver_class = JDBC_DRIVER_CLASS_MYSQL + jdbc_name = jdbc_driver_mysql_name elif db_name == DB_ORACLE: jdbc_driver_oracle_name = default("/hostLevelParams/custom_oracle_jdbc_name", None) - if not jdbc_driver_oracle_name: - no_jdbc_error_message = "The Oracle JDBC driver has not been set. Please ensure that you have executed 'ambari-server setup --jdbc-db=oracle --jdbc-driver=/path/to/jdbc_driver'." - else: - jdbc_url = jdk_location + jdbc_driver_oracle_name - jdbc_driver_class = JDBC_DRIVER_CLASS_ORACLE - jdbc_name = jdbc_driver_oracle_name + jdbc_url = jdk_location + jdbc_driver_oracle_name + jdbc_driver_class = JDBC_DRIVER_CLASS_ORACLE + jdbc_name = jdbc_driver_oracle_name elif db_name == DB_POSTGRESQL: jdbc_driver_postgres_name = default("/hostLevelParams/custom_postgres_jdbc_name", None) - if not jdbc_driver_postgres_name: - no_jdbc_error_message = "The Postgres JDBC driver has not been set. Please ensure that you have executed 'ambari-server setup --jdbc-db=postgres --jdbc-driver=/path/to/jdbc_driver'." - else: - jdbc_url = jdk_location + jdbc_driver_postgres_name - jdbc_driver_class = JDBC_DRIVER_CLASS_POSTGRESQL - jdbc_name = jdbc_driver_postgres_name + jdbc_url = jdk_location + jdbc_driver_postgres_name + jdbc_driver_class = JDBC_DRIVER_CLASS_POSTGRESQL + jdbc_name = jdbc_driver_postgres_name elif db_name == DB_MSSQL: jdbc_driver_mssql_name = default("/hostLevelParams/custom_mssql_jdbc_name", None) - if not jdbc_driver_mssql_name: - no_jdbc_error_message = "The MSSQL JDBC driver has not been set. Please ensure that you have executed 'ambari-server setup --jdbc-db=mssql --jdbc-driver=/path/to/jdbc_driver'." - else: - jdbc_url = jdk_location + jdbc_driver_mssql_name - jdbc_driver_class = JDBC_DRIVER_CLASS_MSSQL - jdbc_name = jdbc_driver_mssql_name + jdbc_url = jdk_location + jdbc_driver_mssql_name + jdbc_driver_class = JDBC_DRIVER_CLASS_MSSQL + jdbc_name = jdbc_driver_mssql_name elif db_name == DB_SQLA: jdbc_driver_sqla_name = default("/hostLevelParams/custom_sqlanywhere_jdbc_name", None) - if not jdbc_driver_sqla_name: - no_jdbc_error_message = "The SQLAnywhere JDBC driver has not been set. Please ensure that you have executed 'ambari-server setup --jdbc-db=sqlanywhere --jdbc-driver=/path/to/jdbc_driver'." - else: - jdbc_url = jdk_location + jdbc_driver_sqla_name - jdbc_driver_class = JDBC_DRIVER_CLASS_SQLA - jdbc_name = jdbc_driver_sqla_name - - if no_jdbc_error_message: - Logger.warning(no_jdbc_error_message) - db_connection_check_structured_output = {"exit_code" : 1, "message": no_jdbc_error_message} - return db_connection_check_structured_output - + jdbc_url = jdk_location + jdbc_driver_sqla_name + jdbc_driver_class = JDBC_DRIVER_CLASS_SQLA + jdbc_name = jdbc_driver_sqla_name + db_connection_url = config['commandParams']['db_connection_url'] user_name = config['commandParams']['user_name'] user_passwd = config['commandParams']['user_passwd']
