AMBARI-14484 JDK was installed with incorrect permissions on agent host (dsen)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a69a5445 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a69a5445 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a69a5445 Branch: refs/heads/branch-dev-patch-upgrade Commit: a69a54456d26087dd12d82d85fee347dd42c87b6 Parents: c32cbbe Author: Dmytro Sen <[email protected]> Authored: Wed Dec 23 16:34:58 2015 +0200 Committer: Dmytro Sen <[email protected]> Committed: Wed Dec 23 16:34:58 2015 +0200 ---------------------------------------------------------------------- .../2.0.6/hooks/before-ANY/scripts/shared_initialization.py | 6 ++---- .../python/stacks/2.0.6/hooks/before-ANY/test_before_any.py | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/a69a5445/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py index 6db30d2..66facc4 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py @@ -211,8 +211,6 @@ def setup_java(): mode=0755, cd_access="a", ) - Directory(params.java_home, - owner = getpass.getuser(), - group = params.user_group, - recursive_ownership = True, + Execute(('chmod', '-R', '755', params.java_home), + sudo = True, ) http://git-wip-us.apache.org/repos/asf/ambari/blob/a69a5445/ambari-server/src/test/python/stacks/2.0.6/hooks/before-ANY/test_before_any.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-ANY/test_before_any.py b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-ANY/test_before_any.py index 4020ede..3431d46 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-ANY/test_before_any.py +++ b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-ANY/test_before_any.py @@ -189,10 +189,8 @@ class TestHookBeforeInstall(RMFTestCase): mode = 0755, cd_access = "a", ) - self.assertResourceCalled('Directory', '/usr/jdk64/jdk1.7.0_45', - owner = 'some_user', - group = 'hadoop', - recursive_ownership = True, + self.assertResourceCalled('Execute', ('chmod', '-R', '755', u'/usr/jdk64/jdk1.7.0_45'), + sudo = True, ) self.assertNoMoreResources()
