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)

2016-12-23 Thread vbrodetskyi
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-18901 ed6add2f4 -> 7963f5483


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 7963f5483d321a7ee9022337f7e35a17e511718a
Parents: ed6add2
Author: Vitaly Brodetskyi 
Authored: Sat Dec 24 00:30:47 2016 +0200
Committer: Vitaly Brodetskyi 
Committed: Sat Dec 24 00:30:47 2016 +0200

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/7963f548/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 459105f..67138a4 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
@@ -106,7 +106,9 @@ def hive(name=None):
 @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
   if name == 'hiveserver2':
 # copy tarball to HDFS feature not supported
 if not (params.stack_version_formatted_major and 
check_stack_feature(StackFeature.COPY_TARBALL_TO_HDFS, 
params.stack_version_formatted_major)):
@@ -226,7 +228,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:
@@ -254,7 +256,7 @@ def hive(name=None):
   File(format("{hive_config_dir}/hive-env.sh"),
owner=params.hive_user,
group=params.user_group,
-   mode=0600,
+   mode=mode_identified,
content=InlineTemplate(params.hive_env_sh_template)
   )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7963f548/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.getConf

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)

2016-12-23 Thread vbrodetskyi
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 050caf012 -> c2d9c1b72


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

Branch: refs/heads/branch-2.5
Commit: c2d9c1b72a2546b718f00ff5bd300a069cd9366b
Parents: 050caf0
Author: Vitaly Brodetskyi 
Authored: Sat Dec 24 00:20:21 2016 +0200
Committer: Vitaly Brodetskyi 
Committed: Sat Dec 24 00:20:21 2016 +0200

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


http://git-wip-us.apache.org/repos/asf/ambari/blob/c2d9c1b7/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 459105f..67138a4 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
@@ -106,7 +106,9 @@ def hive(name=None):
 @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
   if name == 'hiveserver2':
 # copy tarball to HDFS feature not supported
 if not (params.stack_version_formatted_major and 
check_stack_feature(StackFeature.COPY_TARBALL_TO_HDFS, 
params.stack_version_formatted_major)):
@@ -226,7 +228,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:
@@ -254,7 +256,7 @@ def hive(name=None):
   File(format("{hive_config_dir}/hive-env.sh"),
owner=params.hive_user,
group=params.user_group,
-   mode=0600,
+   mode=mode_identified,
content=InlineTemplate(params.hive_env_sh_template)
   )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c2d9c1b7/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']['

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)

2016-12-23 Thread 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 
Authored: Sat Dec 24 00:13:49 2016 +0200
Committer: Vitaly Brodetskyi 
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 =