Repository: ambari Updated Branches: refs/heads/trunk c902a32b1 -> 8779baea9
AMBARI-10686. Ranger Admin Install fails with an Attribute Error (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/8779baea Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/8779baea Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/8779baea Branch: refs/heads/trunk Commit: 8779baea98e546fa120f8bc9c3eec367c7ba6423 Parents: c902a32 Author: Andrew Onishuk <[email protected]> Authored: Thu Apr 23 19:59:15 2015 +0300 Committer: Andrew Onishuk <[email protected]> Committed: Thu Apr 23 19:59:15 2015 +0300 ---------------------------------------------------------------------- .../RANGER/0.4.0/package/scripts/setup_ranger.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/8779baea/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger.py b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger.py index 391df2a..cc85b90 100644 --- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger.py +++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger.py @@ -83,18 +83,21 @@ def check_db_connnection(): import params Logger.info('Checking DB connection') - + env_dict = {} if params.db_flavor.lower() == 'mysql': cmd = format('{sql_command_invoker} -u {db_root_user} --password={db_root_password} -h {db_host} -s -e "select version();"') elif params.db_flavor.lower() == 'oracle': cmd = format('{sql_command_invoker} {db_root_user}/{db_root_password}@{db_host} AS SYSDBA') + env_dict = {'ORACLE_HOME':params.oracle_home, 'LD_LIBRARY_PATH':params.oracle_home} elif params.db_flavor.lower() == 'postgres': cmd = 'true' elif params.db_flavor.lower() == 'sqlserver': cmd = 'true' try: - Execute(cmd) + Execute(cmd, + environment=env_dict, + logoutput=True) except Fail as ex: - Logger.info(ex) - raise Fail('Ranger Admin installation Failed! Ranger requires DB client installed on Ranger Host, DB administrative privileges configured for connectivity from the Ranger Admin host to the configured DB host/instance and the DB server up and running on the DB host.') + Logger.error(str(ex)) + raise Fail('Ranger Database connection check failed')
