You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vb...@apache.org on 2016/12/23 22:14:35 UTC

ambari git commit: AMBARI-19119. Fix hive-site.xml and hive-env.sh permissions for /etc/hive/conf (client) folder from 600 to 644.(vbrodetskyi)

Repository: ambari
Updated Branches:
  refs/heads/trunk 0a1d7c2a9 -> ecaf9b88d


AMBARI-19119. Fix hive-site.xml and hive-env.sh permissions for /etc/hive/conf (client) folder from 600 to 644.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: ecaf9b88d4c219e658aad95ec79d8294620ca145
Parents: 0a1d7c2
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Sat Dec 24 00:13:49 2016 +0200
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Sat Dec 24 00:13:49 2016 +0200

----------------------------------------------------------------------
 .../HIVE/0.12.0.2.0/package/scripts/hive.py               | 10 +++++++---
 .../src/test/python/stacks/2.0.6/HIVE/test_hive_client.py |  8 ++++----
 2 files changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ecaf9b88/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
index 6344ed7..ea21c49 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
@@ -48,7 +48,11 @@ from ambari_commons import OSConst
 @OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT)
 def hive(name=None):
   import params
-    
+
+  hive_client_conf_path = format("{stack_root}/current/{component_directory}/conf")
+  # Permissions 644 for conf dir (client) files, and 600 for conf.server
+  mode_identified = 0644 if params.hive_config_dir == hive_client_conf_path else 0600
+
   Directory(params.hive_etc_dir_prefix,
             mode=0755
   )
@@ -65,7 +69,7 @@ def hive(name=None):
             configuration_attributes=params.config['configuration_attributes']['hive-site'],
             owner=params.hive_user,
             group=params.user_group,
-            mode=0600)
+            mode=mode_identified)
 
   # Generate atlas-application.properties.xml file
   if params.enable_atlas_hook:
@@ -76,7 +80,7 @@ def hive(name=None):
        owner=params.hive_user,
        group=params.user_group,
        content=InlineTemplate(params.hive_env_sh_template),
-       mode=0600
+       mode=mode_identified
   )
 
   # On some OS this folder could be not exists, so we will create it before pushing there files

http://git-wip-us.apache.org/repos/asf/ambari/blob/ecaf9b88/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
index 1a7256f..265f040 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_client.py
@@ -75,7 +75,7 @@ class TestHiveClient(RMFTestCase):
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
                               group = 'hadoop',
                               conf_dir = '/usr/hdp/current/hive-client/conf',
-                              mode = 0600,
+                              mode = 0644,
                               configuration_attributes = self.getConfig()['configuration_attributes']['hive-site'],
                               owner = 'hive',
                               configurations = self.getConfig()['configurations']['hive-site'],
@@ -84,7 +84,7 @@ class TestHiveClient(RMFTestCase):
                               content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
                               owner = 'hive',
                               group = 'hadoop',
-                              mode = 0600,
+                              mode = 0644,
                               )
     self.assertResourceCalled('Directory', '/etc/security/limits.d',
                               owner = 'root',
@@ -155,7 +155,7 @@ class TestHiveClient(RMFTestCase):
     self.assertResourceCalled('XmlConfig', 'hive-site.xml',
                               group = 'hadoop',
                               conf_dir = '/usr/hdp/current/hive-client/conf',
-                              mode = 0600,
+                              mode = 0644,
                               configuration_attributes = self.getConfig()['configuration_attributes']['hive-site'],
                               owner = 'hive',
                               configurations = self.getConfig()['configurations']['hive-site'],
@@ -164,7 +164,7 @@ class TestHiveClient(RMFTestCase):
                               content = InlineTemplate(self.getConfig()['configurations']['hive-env']['content']),
                               owner = 'hive',
                               group = 'hadoop',
-                              mode = 0600,
+                              mode = 0644,
                               )
     self.assertResourceCalled('Directory', '/etc/security/limits.d',
                               owner = 'root',