Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 78EF22009EE for ; Wed, 18 May 2016 17:27:02 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7794F160A15; Wed, 18 May 2016 15:27:02 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CA2671609B0 for ; Wed, 18 May 2016 17:27:01 +0200 (CEST) Received: (qmail 36795 invoked by uid 500); 18 May 2016 15:27:01 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 36781 invoked by uid 99); 18 May 2016 15:27:01 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 May 2016 15:27:01 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BE03BE009E; Wed, 18 May 2016 15:27:00 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aonishuk@apache.org To: commits@ambari.apache.org Date: Wed, 18 May 2016 15:27:00 -0000 Message-Id: <5ad0e4ff721e451faeb99a1faf5143f9@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] ambari git commit: AMBARI-16735. HDFS data disk mount point permissions (aonishuk) archived-at: Wed, 18 May 2016 15:27:02 -0000 Repository: ambari Updated Branches: refs/heads/branch-2.4 2225ad2a7 -> 049c5838e refs/heads/trunk 4426c62ed -> 3f080663a AMBARI-16735. HDFS data disk mount point permissions (aonishuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/3f080663 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/3f080663 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/3f080663 Branch: refs/heads/trunk Commit: 3f080663a4b84ddf8cae52fcbf05599114503e1b Parents: 4426c62 Author: Andrew Onishuk Authored: Wed May 18 18:26:52 2016 +0300 Committer: Andrew Onishuk Committed: Wed May 18 18:26:52 2016 +0300 ---------------------------------------------------------------------- .../python/resource_management/TestDatanodeHelper.py | 12 +++++++++--- .../libraries/functions/dfs_datanode_helper.py | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/3f080663/ambari-agent/src/test/python/resource_management/TestDatanodeHelper.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/test/python/resource_management/TestDatanodeHelper.py b/ambari-agent/src/test/python/resource_management/TestDatanodeHelper.py index 4a1a1ba..1f16668 100644 --- a/ambari-agent/src/test/python/resource_management/TestDatanodeHelper.py +++ b/ambari-agent/src/test/python/resource_management/TestDatanodeHelper.py @@ -22,6 +22,7 @@ from mock.mock import Mock, MagicMock, patch from resource_management.libraries.functions import dfs_datanode_helper from resource_management.core.logger import Logger +from resource_management import Directory class StubParams(object): @@ -61,11 +62,14 @@ class TestDatanodeHelper(TestCase): params = StubParams() params.data_dir_mount_file = "/var/lib/ambari-agent/data/datanode/dfs_data_dir_mount.hist" params.dfs_data_dir = "{0},{1},{2}".format(grid0, grid1, grid2) + params.hdfs_user = "hdfs_test" + params.user_group = "hadoop_test" + @patch.object(Logger, "warning") @patch.object(Logger, "info") @patch.object(Logger, "error") - def test_normalized(self, log_error, log_info): + def test_normalized(self, log_error, log_info, warning_info): """ Test that the data dirs are normalized by removing leading and trailing whitespace, and case sensitive. """ @@ -93,7 +97,8 @@ class TestDatanodeHelper(TestCase): @patch.object(dfs_datanode_helper, "get_mount_point_for_dir") @patch.object(os.path, "isdir") @patch.object(os.path, "exists") - def test_grid_becomes_unmounted(self, mock_os_exists, mock_os_isdir, mock_get_mount_point, mock_get_data_dir_to_mount_from_file, log_error, log_info): + def test_grid_becomes_unmounted(self, mock_os_exists, mock_os_isdir, mock_get_mount_point, + mock_get_data_dir_to_mount_from_file, log_error, log_info): """ Test when grid2 becomes unmounted """ @@ -126,7 +131,8 @@ class TestDatanodeHelper(TestCase): @patch.object(dfs_datanode_helper, "get_mount_point_for_dir") @patch.object(os.path, "isdir") @patch.object(os.path, "exists") - def test_grid_becomes_remounted(self, mock_os_exists, mock_os_isdir, mock_get_mount_point, mock_get_data_dir_to_mount_from_file, log_error, log_info): + def test_grid_becomes_remounted(self, mock_os_exists, mock_os_isdir, mock_get_mount_point, + mock_get_data_dir_to_mount_from_file, log_error, log_info): """ Test when grid2 becomes remounted """ http://git-wip-us.apache.org/repos/asf/ambari/blob/3f080663/ambari-common/src/main/python/resource_management/libraries/functions/dfs_datanode_helper.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/dfs_datanode_helper.py b/ambari-common/src/main/python/resource_management/libraries/functions/dfs_datanode_helper.py index 33e7b41..571c089 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/dfs_datanode_helper.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/dfs_datanode_helper.py @@ -155,6 +155,7 @@ def handle_dfs_data_dir(func, params, update_cache=True): if os.path.isdir(data_dir) and data_dir not in data_dirs_unmounted: curr_mount_point = get_mount_point_for_dir(data_dir) data_dir_to_mount_point[data_dir] = curr_mount_point + func(data_dir, params) if error_messages and len(error_messages) > 0: header = " ERROR ".join(["*****"] * 6)