ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alejan...@apache.org
Subject ambari git commit: AMBARI-12617. Ranger admin install fails with umask 027 (Gautam Borad via alejandro)
Date Wed, 05 Aug 2015 20:48:36 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk c2c762120 -> b32bf6e42


AMBARI-12617. Ranger admin install fails with umask 027 (Gautam Borad via alejandro)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b32bf6e4
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b32bf6e4
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b32bf6e4

Branch: refs/heads/trunk
Commit: b32bf6e424b2badc7293f8cbf7cc27afe69f0e49
Parents: c2c7621
Author: Alejandro Fernandez <afernandez@hortonworks.com>
Authored: Wed Aug 5 13:46:43 2015 -0700
Committer: Alejandro Fernandez <afernandez@hortonworks.com>
Committed: Wed Aug 5 13:46:43 2015 -0700

----------------------------------------------------------------------
 .../libraries/functions/setup_ranger_plugin.py  |  7 +++++--
 .../functions/setup_ranger_plugin_xml.py        |  7 +++++--
 .../0.4.0/package/scripts/setup_ranger.py       |  6 ++++--
 .../0.4.0/package/scripts/setup_ranger_xml.py   | 22 +++++++++++---------
 .../stacks/2.2/RANGER/test_ranger_admin.py      | 10 +++++++--
 5 files changed, 34 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b32bf6e4/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin.py
b/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin.py
index 35d4953..a675d97 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin.py
@@ -39,14 +39,17 @@ def setup_ranger_plugin(component_select_name, service_name,
                         policy_user, policymgr_mgr_url,
                         plugin_enabled,api_version=None, **kwargs):
   File(downloaded_custom_connector,
-       content = DownloadSource(driver_curl_source)
+      content = DownloadSource(driver_curl_source),
+      mode = 0644
   )
 
   Execute(('cp', '--remove-destination', downloaded_custom_connector, driver_curl_target),
-          not_if=format("test -f {driver_curl_target}"),
+          path=["/bin", "/usr/bin/"],
           sudo=True
   )
 
+  File(driver_curl_target, mode=0644)
+
   hdp_version = get_hdp_version(component_select_name)
   file_path = format('/usr/hdp/{hdp_version}/ranger-{service_name}-plugin/install.properties')
   

http://git-wip-us.apache.org/repos/asf/ambari/blob/b32bf6e4/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin_xml.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin_xml.py
b/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin_xml.py
index 070dec6..74f0e83 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin_xml.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/setup_ranger_plugin_xml.py
@@ -47,7 +47,8 @@ def setup_ranger_plugin(component_select_name, service_name,
                         ssl_keystore_password, api_version=None, hdp_version_override = None):
 
   File(component_downloaded_custom_connector,
-    content = DownloadSource(component_driver_curl_source)
+    content = DownloadSource(component_driver_curl_source),
+    mode = 0644
   )
 
   directory_path = os.path.dirname(component_driver_curl_target)
@@ -59,10 +60,12 @@ def setup_ranger_plugin(component_select_name, service_name,
     )
 
   Execute(('cp', '--remove-destination', component_downloaded_custom_connector, component_driver_curl_target),
-    not_if=format("test -f {component_driver_curl_target}"),
+    path=["/bin", "/usr/bin/"],
     sudo=True
   )
 
+  File(component_driver_curl_target, mode=0644)
+
   hdp_version = get_hdp_version(component_select_name)
   if hdp_version_override is not None:
     hdp_version = hdp_version_override

http://git-wip-us.apache.org/repos/asf/ambari/blob/b32bf6e4/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 e1498b6..d0fea38 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
@@ -36,13 +36,15 @@ def setup_ranger_admin():
   check_db_connnection()
   
   File(params.downloaded_custom_connector,
-       content = DownloadSource(params.driver_curl_source)
+      content = DownloadSource(params.driver_curl_source),
+      mode = 0644
   )
 
   Execute(('cp', '--remove-destination', params.downloaded_custom_connector, params.driver_curl_target),
           path=["/bin", "/usr/bin/"],
-          not_if=format("test -f {driver_curl_target}"),
           sudo=True)
+
+  File(params.driver_curl_target, mode=0644)
   
   ModifyPropertiesFile(format("{ranger_home}/install.properties"),
     properties = params.config['configurations']['admin-properties']

http://git-wip-us.apache.org/repos/asf/ambari/blob/b32bf6e4/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
index f20f5c9..c3008aa 100644
--- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
+++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py
@@ -108,27 +108,29 @@ def setup_ranger_db(rolling_upgrade=False):
   import params
   
   File(params.downloaded_custom_connector,
-    content = DownloadSource(params.driver_curl_source)
+    content = DownloadSource(params.driver_curl_source),
+    mode = 0644
   )
 
   Directory(params.java_share_dir,
     mode=0755
   )
 
-  if not os.path.isfile(params.driver_curl_target):
-    Execute(('cp', '--remove-destination', params.downloaded_custom_connector, params.driver_curl_target),
-      path=["/bin", "/usr/bin/"],
-      not_if=format("test -f {driver_curl_target}"),
-      sudo=True)
+  Execute(('cp', '--remove-destination', params.downloaded_custom_connector, params.driver_curl_target),
+    path=["/bin", "/usr/bin/"],
+    sudo=True)
+
+  File(params.driver_curl_target, mode=0644)
 
   ranger_home = params.ranger_home
   if rolling_upgrade:
     ranger_home = format("/usr/hdp/{version}/ranger-admin")
 
-  if not os.path.isfile(os.path.join(params.ranger_home, 'ews', 'lib',params.jdbc_jar_name)):
-    Execute(('cp', '--remove-destination', params.downloaded_custom_connector, os.path.join(params.ranger_home,
'ews', 'lib')),
-      path=["/bin", "/usr/bin/"],
-      sudo=True)
+  Execute(('cp', '--remove-destination', params.downloaded_custom_connector, os.path.join(params.ranger_home,
'ews', 'lib')),
+    path=["/bin", "/usr/bin/"],
+    sudo=True)
+
+  File(os.path.join(params.ranger_home, 'ews', 'lib',params.jdbc_jar_name), mode=0644)
 
   ModifyPropertiesFile(format("{ranger_home}/install.properties"),
     properties = params.config['configurations']['admin-properties'],

http://git-wip-us.apache.org/repos/asf/ambari/blob/b32bf6e4/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 0d3f0e0..813112d 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
@@ -115,15 +115,18 @@ class TestRangerAdmin(RMFTestCase):
                               environment = {})
     self.assertResourceCalled('File', '/tmp/mysql-connector-java.jar',
         content = DownloadSource('http://c6401.ambari.apache.org:8080/resources//mysql-jdbc-driver.jar'),
+        mode = 0644
     )
     self.assertResourceCalled('Execute', ('cp',
      '--remove-destination',
      '/tmp/mysql-connector-java.jar',
      '/usr/share/java/mysql-connector-java.jar'),
-        not_if = 'test -f /usr/share/java/mysql-connector-java.jar',
         sudo = True,
         path = ['/bin', '/usr/bin/'],
     )
+    self.assertResourceCalled('File', '/usr/share/java/mysql-connector-java.jar',
+      mode = 0644
+    )
     self.assertResourceCalled('ModifyPropertiesFile', '/usr/hdp/current/ranger-admin/install.properties',
         properties = self.getConfig()['configurations']['admin-properties'],
     )
@@ -144,15 +147,18 @@ class TestRangerAdmin(RMFTestCase):
                               environment = {})
     self.assertResourceCalled('File', '/tmp/mysql-connector-java.jar',
         content = DownloadSource('http://c6401.ambari.apache.org:8080/resources//mysql-jdbc-driver.jar'),
+        mode = 0644
     )
     self.assertResourceCalled('Execute', ('cp',
      '--remove-destination',
      '/tmp/mysql-connector-java.jar',
      '/usr/share/java/mysql-connector-java.jar'),
-        not_if = 'test -f /usr/share/java/mysql-connector-java.jar',
         sudo = True,
         path = ['/bin', '/usr/bin/'],
     )
+    self.assertResourceCalled('File', '/usr/share/java/mysql-connector-java.jar',
+      mode = 0644
+    )
     self.assertResourceCalled('ModifyPropertiesFile', '/usr/hdp/current/ranger-admin/install.properties',
         properties = self.getConfig()['configurations']['admin-properties'],
     )


Mime
View raw message