ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject ambari git commit: AMBARI-10686. Ranger Admin Install fails with an Attribute Error (aonishuk)
Date Fri, 24 Apr 2015 09:58:45 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 6553e6a19 -> 3e30ca267


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/3e30ca26
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3e30ca26
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3e30ca26

Branch: refs/heads/trunk
Commit: 3e30ca2677916333cdef282bcfda82c04e3b3753
Parents: 6553e6a
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Fri Apr 24 12:58:38 2015 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Fri Apr 24 12:58:38 2015 +0300

----------------------------------------------------------------------
 .../RANGER/0.4.0/package/scripts/setup_ranger.py         | 11 +++++++----
 .../test/python/stacks/2.2/RANGER/test_ranger_admin.py   |  6 ++++--
 2 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3e30ca26/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')

http://git-wip-us.apache.org/repos/asf/ambari/blob/3e30ca26/ambari-server/src/test/python/stacks/2.2/RANGER/test_ranger_admin.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.2/RANGER/test_ranger_admin.py b/ambari-server/src/test/python/stacks/2.2/RANGER/test_ranger_admin.py
index 4bff50f..6ac0b63 100644
--- a/ambari-server/src/test/python/stacks/2.2/RANGER/test_ranger_admin.py
+++ b/ambari-server/src/test/python/stacks/2.2/RANGER/test_ranger_admin.py
@@ -103,7 +103,8 @@ class TestRangerAdmin(RMFTestCase):
     self.assertNoMoreResources()
 
   def assert_configure_default(self):
-    self.assertResourceCalled('Execute', 'mysql -u root --password=aa -h localhost  -s -e
"select version();"',)
+    self.assertResourceCalled('Execute', 'mysql -u root --password=aa -h localhost  -s -e
"select version();"',logoutput = True,
+                              environment = {})
     self.assertResourceCalled('File', '/tmp/mysql-connector-java.jar',
         content = DownloadSource('http://c6401.ambari.apache.org:8080/resources//mysql-jdbc-driver.jar'),
     )
@@ -131,7 +132,8 @@ class TestRangerAdmin(RMFTestCase):
     )
       
   def assert_configure_secured(self):
-    self.assertResourceCalled('Execute', 'mysql -u root --password=rootpassword -h localhost
 -s -e "select version();"',)
+    self.assertResourceCalled('Execute', 'mysql -u root --password=rootpassword -h localhost
 -s -e "select version();"',logoutput = True,
+                              environment = {})
     self.assertResourceCalled('File', '/tmp/mysql-connector-java.jar',
         content = DownloadSource('http://c6401.ambari.apache.org:8080/resources//mysql-jdbc-driver.jar'),
     )


Mime
View raw message