ambari git commit: AMBARI-19005. "conf.server" dir for HIVE1 and HIVE2 should have 700 permission and files in it should have 600 permission.(vbrodetskyi)

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


AMBARI-19005. "conf.server" dir for HIVE1 and HIVE2 should have 700 permission 
and files in it should have 600 permission.(vbrodetskyi)


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: ed6add2f45bbc59d37fa5cc274214472c8435b9f
Parents: 35428030
Author: Vitaly Brodetskyi 
Authored: Fri Dec 23 19:54:12 2016 +0200
Committer: Vitaly Brodetskyi 
Committed: Fri Dec 23 19:54:12 2016 +0200

--
 .../HIVE/0.12.0.2.0/package/scripts/hive.py |  38 ++--
 .../package/scripts/hive_interactive.py |  20 +-
 .../stacks/2.0.6/HIVE/test_hive_client.py   |  12 +-
 .../stacks/2.0.6/HIVE/test_hive_metastore.py|  33 ++-
 .../stacks/2.0.6/HIVE/test_hive_server.py   |  22 +-
 .../stacks/2.1/HIVE/test_hive_metastore.py  |  18 +-
 .../stacks/2.5/HIVE/test_hive_server_int.py | 206 +--
 7 files changed, 241 insertions(+), 108 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ed6add2f/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 792aac3..459105f 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
@@ -109,7 +109,7 @@ def hive(name=None):
 
   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)):  
+if not (params.stack_version_formatted_major and 
check_stack_feature(StackFeature.COPY_TARBALL_TO_HDFS, 
params.stack_version_formatted_major)):
   params.HdfsResource(params.webhcat_apps_dir,
 type="directory",
 action="create_on_execute",
@@ -226,13 +226,13 @@ def hive(name=None):
 
configuration_attributes=params.config['configuration_attributes']['hive-site'],
 owner=params.hive_user,
 group=params.user_group,
-mode=0644)
+mode=0600)
 
   # Generate atlas-application.properties.xml file
   if params.enable_atlas_hook:
 atlas_hook_filepath = os.path.join(params.hive_config_dir, 
params.atlas_hook_filename)
 setup_atlas_hook(SERVICE.HIVE, params.hive_atlas_application_properties, 
atlas_hook_filepath, params.hive_user, params.user_group)
-  
+
   if name == 'hiveserver2':
 XmlConfig("hiveserver2-site.xml",
   conf_dir=params.hive_server_conf_dir,
@@ -240,7 +240,7 @@ def hive(name=None):
   
configuration_attributes=params.config['configuration_attributes']['hiveserver2-site'],
   owner=params.hive_user,
   group=params.user_group,
-  mode=0644)
+  mode=0600)
 
   if params.hive_metastore_site_supported and name == 'metastore':
 XmlConfig("hivemetastore-site.xml",
@@ -249,11 +249,12 @@ def hive(name=None):
   
configuration_attributes=params.config['configuration_attributes']['hivemetastore-site'],
   owner=params.hive_user,
   group=params.user_group,
-  mode=0644)
-  
+  mode=0600)
+
   File(format("{hive_config_dir}/hive-env.sh"),
owner=params.hive_user,
group=params.user_group,
+   mode=0600,
content=InlineTemplate(params.hive_env_sh_template)
   )
 
@@ -286,6 +287,7 @@ def hive(name=None):
 File(os.path.join(params.hive_server_conf_dir, 
"hadoop-metrics2-hivemetastore.properties"),
  owner=params.hive_user,
  group=params.user_group,
+ mode=0600,
  content=Template("hadoop-metrics2-hivemetastore.properties.j2")
 )
 
@@ -328,6 +330,7 @@ def hive(name=None):
 File(os.path.join(params.hive_server_conf_dir, 
"hadoop-metrics2-hiveserver2.properties"),
  owner=params.hive_user,
  group=params.user_group,
+ mode=0600,
  content=Template("hadoop-metrics2-hiveserver2.properties.j2")
 )
 
@@ -356,11 +359,16 @@ Writes configuration files required by Hive.
 """
 def fill_conf_dir(component_conf_dir):
   import params
+  

ambari git commit: AMBARI-19005. "conf.server" dir for HIVE1 and HIVE2 should have 700 permission and files in it should have 600 permission.(vbrodetskyi)

2016-12-23 Thread vbrodetskyi
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 d146df7ee -> 003cebcc8


AMBARI-19005. "conf.server" dir for HIVE1 and HIVE2 should have 700 permission 
and files in it should have 600 permission.(vbrodetskyi)


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

Branch: refs/heads/branch-2.5
Commit: 003cebcc87a0e9e905728ad04d30a93b083ca8e4
Parents: d146df7
Author: Vitaly Brodetskyi 
Authored: Fri Dec 23 19:47:21 2016 +0200
Committer: Vitaly Brodetskyi 
Committed: Fri Dec 23 19:47:21 2016 +0200

--
 .../HIVE/0.12.0.2.0/package/scripts/hive.py |  38 ++--
 .../package/scripts/hive_interactive.py |  20 +-
 .../stacks/2.0.6/HIVE/test_hive_client.py   |  12 +-
 .../stacks/2.0.6/HIVE/test_hive_metastore.py|  33 ++-
 .../stacks/2.0.6/HIVE/test_hive_server.py   |  22 +-
 .../stacks/2.1/HIVE/test_hive_metastore.py  |  18 +-
 .../stacks/2.5/HIVE/test_hive_server_int.py | 206 +--
 7 files changed, 241 insertions(+), 108 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/003cebcc/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 792aac3..459105f 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
@@ -109,7 +109,7 @@ def hive(name=None):
 
   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)):  
+if not (params.stack_version_formatted_major and 
check_stack_feature(StackFeature.COPY_TARBALL_TO_HDFS, 
params.stack_version_formatted_major)):
   params.HdfsResource(params.webhcat_apps_dir,
 type="directory",
 action="create_on_execute",
@@ -226,13 +226,13 @@ def hive(name=None):
 
configuration_attributes=params.config['configuration_attributes']['hive-site'],
 owner=params.hive_user,
 group=params.user_group,
-mode=0644)
+mode=0600)
 
   # Generate atlas-application.properties.xml file
   if params.enable_atlas_hook:
 atlas_hook_filepath = os.path.join(params.hive_config_dir, 
params.atlas_hook_filename)
 setup_atlas_hook(SERVICE.HIVE, params.hive_atlas_application_properties, 
atlas_hook_filepath, params.hive_user, params.user_group)
-  
+
   if name == 'hiveserver2':
 XmlConfig("hiveserver2-site.xml",
   conf_dir=params.hive_server_conf_dir,
@@ -240,7 +240,7 @@ def hive(name=None):
   
configuration_attributes=params.config['configuration_attributes']['hiveserver2-site'],
   owner=params.hive_user,
   group=params.user_group,
-  mode=0644)
+  mode=0600)
 
   if params.hive_metastore_site_supported and name == 'metastore':
 XmlConfig("hivemetastore-site.xml",
@@ -249,11 +249,12 @@ def hive(name=None):
   
configuration_attributes=params.config['configuration_attributes']['hivemetastore-site'],
   owner=params.hive_user,
   group=params.user_group,
-  mode=0644)
-  
+  mode=0600)
+
   File(format("{hive_config_dir}/hive-env.sh"),
owner=params.hive_user,
group=params.user_group,
+   mode=0600,
content=InlineTemplate(params.hive_env_sh_template)
   )
 
@@ -286,6 +287,7 @@ def hive(name=None):
 File(os.path.join(params.hive_server_conf_dir, 
"hadoop-metrics2-hivemetastore.properties"),
  owner=params.hive_user,
  group=params.user_group,
+ mode=0600,
  content=Template("hadoop-metrics2-hivemetastore.properties.j2")
 )
 
@@ -328,6 +330,7 @@ def hive(name=None):
 File(os.path.join(params.hive_server_conf_dir, 
"hadoop-metrics2-hiveserver2.properties"),
  owner=params.hive_user,
  group=params.user_group,
+ mode=0600,
  content=Template("hadoop-metrics2-hiveserver2.properties.j2")
 )
 
@@ -356,11 +359,16 @@ Writes configuration files required by Hive.
 """
 def fill_conf_dir(component_conf_dir):
   import params
+  hive_client_conf_path = 

ambari git commit: AMBARI-19005. "conf.server" dir for HIVE1 and HIVE2 should have 700 permission and files in it should have 600 permission.(vbrodetskyi)

2016-12-23 Thread vbrodetskyi
Repository: ambari
Updated Branches:
  refs/heads/trunk b536a9cbc -> 7c2c14d97


AMBARI-19005. "conf.server" dir for HIVE1 and HIVE2 should have 700 permission 
and files in it should have 600 permission.(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: 7c2c14d976b2099876f1e801a8ddd60c7549c0fc
Parents: b536a9c
Author: Vitaly Brodetskyi 
Authored: Fri Dec 23 19:38:41 2016 +0200
Committer: Vitaly Brodetskyi 
Committed: Fri Dec 23 19:39:22 2016 +0200

--
 .../HIVE/0.12.0.2.0/package/scripts/hive.py |  39 ++--
 .../package/scripts/hive_interactive.py |  20 +-
 .../stacks/2.0.6/HIVE/test_hive_client.py   |  12 +-
 .../stacks/2.0.6/HIVE/test_hive_metastore.py|  33 ++-
 .../stacks/2.0.6/HIVE/test_hive_server.py   |  28 ++-
 .../stacks/2.1/HIVE/test_hive_metastore.py  |  21 +-
 .../stacks/2.5/HIVE/test_hive_server_int.py | 208 +--
 7 files changed, 248 insertions(+), 113 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/7c2c14d9/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 ffc996c..6344ed7 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
@@ -65,7 +65,7 @@ def hive(name=None):
 
configuration_attributes=params.config['configuration_attributes']['hive-site'],
 owner=params.hive_user,
 group=params.user_group,
-mode=0644)
+mode=0600)
 
   # Generate atlas-application.properties.xml file
   if params.enable_atlas_hook:
@@ -75,7 +75,8 @@ def hive(name=None):
   File(format("{hive_config_dir}/hive-env.sh"),
owner=params.hive_user,
group=params.user_group,
-   content=InlineTemplate(params.hive_env_sh_template)
+   content=InlineTemplate(params.hive_env_sh_template),
+   mode=0600
   )
 
   # On some OS this folder could be not exists, so we will create it before 
pushing there files
@@ -115,7 +116,8 @@ def setup_hiveserver2():
   File(os.path.join(params.hive_server_conf_dir, 
"hadoop-metrics2-hiveserver2.properties"),
owner=params.hive_user,
group=params.user_group,
-   content=Template("hadoop-metrics2-hiveserver2.properties.j2")
+   content=Template("hadoop-metrics2-hiveserver2.properties.j2"),
+   mode=0600
   )
   XmlConfig("hiveserver2-site.xml",
 conf_dir=params.hive_server_conf_dir,
@@ -123,7 +125,7 @@ def setup_hiveserver2():
 
configuration_attributes=params.config['configuration_attributes']['hiveserver2-site'],
 owner=params.hive_user,
 group=params.user_group,
-mode=0644)
+mode=0600)
   
   # 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)):  
@@ -264,12 +266,13 @@ def setup_metastore():
   
configuration_attributes=params.config['configuration_attributes']['hivemetastore-site'],
   owner=params.hive_user,
   group=params.user_group,
-  mode=0644)
+  mode=0600)
   
   File(os.path.join(params.hive_server_conf_dir, 
"hadoop-metrics2-hivemetastore.properties"),
owner=params.hive_user,
group=params.user_group,
-   content=Template("hadoop-metrics2-hivemetastore.properties.j2")
+   content=Template("hadoop-metrics2-hivemetastore.properties.j2"),
+   mode=0600
   )
 
   File(params.start_metastore_path,
@@ -308,11 +311,15 @@ Writes configuration files required by Hive.
 """
 def fill_conf_dir(component_conf_dir):
   import params
-
+  hive_client_conf_path = 
os.path.realpath(format("{stack_root}/current/{component_directory}/conf"))
+  component_conf_dir = os.path.realpath(component_conf_dir)
+  mode_identified_for_file = 0644 if component_conf_dir == 
hive_client_conf_path else 0600
+  mode_identified_for_dir = 0755 if component_conf_dir == 
hive_client_conf_path else 0700
   Directory(component_conf_dir,
 owner=params.hive_user,
 group=params.user_group,
-create_parents = True
+

ambari git commit: AMBARI-19005. 'conf.server' dir for HIVE1 and HIVE2 should have 700 permission and files in it should have 600 permission.

2016-11-29 Thread swapan
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-18901 82e9a1d8e -> 24045aa89


AMBARI-19005. 'conf.server' dir for HIVE1 and HIVE2 should have 700 permission 
and files in it should have 600 permission.


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

Branch: refs/heads/branch-feature-AMBARI-18901
Commit: 24045aa89c5ce9c9dc251be1339ce0eadd7c3c2f
Parents: 82e9a1d
Author: Swapan Shridhar 
Authored: Mon Nov 28 16:30:25 2016 -0800
Committer: Swapan Shridhar 
Committed: Tue Nov 29 16:10:03 2016 -0800

--
 .../HIVE/0.12.0.2.0/package/scripts/hive.py | 38 
 .../package/scripts/hive_interactive.py | 20 ++-
 2 files changed, 36 insertions(+), 22 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/24045aa8/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 bcc598a..415261d 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
@@ -109,7 +109,7 @@ def hive(name=None):
 
   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)):  
+if not (params.stack_version_formatted_major and 
check_stack_feature(StackFeature.COPY_TARBALL_TO_HDFS, 
params.stack_version_formatted_major)):
   params.HdfsResource(params.webhcat_apps_dir,
 type="directory",
 action="create_on_execute",
@@ -226,13 +226,13 @@ def hive(name=None):
 
configuration_attributes=params.config['configuration_attributes']['hive-site'],
 owner=params.hive_user,
 group=params.user_group,
-mode=0644)
+mode=0600)
 
   # Generate atlas-application.properties.xml file
   if has_atlas_in_cluster():
 atlas_hook_filepath = os.path.join(params.hive_config_dir, 
params.atlas_hook_filename)
 setup_atlas_hook(SERVICE.HIVE, params.hive_atlas_application_properties, 
atlas_hook_filepath, params.hive_user, params.user_group)
-  
+
   if name == 'hiveserver2':
 XmlConfig("hiveserver2-site.xml",
   conf_dir=params.hive_server_conf_dir,
@@ -240,7 +240,7 @@ def hive(name=None):
   
configuration_attributes=params.config['configuration_attributes']['hiveserver2-site'],
   owner=params.hive_user,
   group=params.user_group,
-  mode=0644)
+  mode=0600)
 
   if params.hive_metastore_site_supported and name == 'metastore':
 XmlConfig("hivemetastore-site.xml",
@@ -249,11 +249,12 @@ def hive(name=None):
   
configuration_attributes=params.config['configuration_attributes']['hivemetastore-site'],
   owner=params.hive_user,
   group=params.user_group,
-  mode=0644)
-  
+  mode=0600)
+
   File(format("{hive_config_dir}/hive-env.sh"),
owner=params.hive_user,
group=params.user_group,
+   mode=0600,
content=InlineTemplate(params.hive_env_sh_template)
   )
 
@@ -286,6 +287,7 @@ def hive(name=None):
 File(os.path.join(params.hive_server_conf_dir, 
"hadoop-metrics2-hivemetastore.properties"),
  owner=params.hive_user,
  group=params.user_group,
+ mode=0600,
  content=Template("hadoop-metrics2-hivemetastore.properties.j2")
 )
 
@@ -328,6 +330,7 @@ def hive(name=None):
 File(os.path.join(params.hive_server_conf_dir, 
"hadoop-metrics2-hiveserver2.properties"),
  owner=params.hive_user,
  group=params.user_group,
+ mode=0600,
  content=Template("hadoop-metrics2-hiveserver2.properties.j2")
 )
 
@@ -356,11 +359,16 @@ Writes configuration files required by Hive.
 """
 def fill_conf_dir(component_conf_dir):
   import params
+  hive_client_conf_path = 
os.path.realpath(format("{stack_root}/current/{component_directory}/conf"))
+  component_conf_dir = os.path.realpath(component_conf_dir)
+  mode_identified_for_file = 0644 if component_conf_dir == 
hive_client_conf_path else 0600
+  mode_identified_for_dir = 0744 if component_conf_dir ==