AMBARI-20081. Install actions fail when switching from root to non-root. (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/709bf6ef Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/709bf6ef Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/709bf6ef Branch: refs/heads/branch-feature-AMBARI-20053 Commit: 709bf6ef3261e609bec1161d02ae6787911e2919 Parents: 2744ae8 Author: Andrew Onishuk <[email protected]> Authored: Mon Feb 20 14:45:43 2017 +0200 Committer: Andrew Onishuk <[email protected]> Committed: Mon Feb 20 14:45:43 2017 +0200 ---------------------------------------------------------------------- .../HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py | 4 ++++ .../test/python/stacks/2.0.6/hooks/before-ANY/test_before_any.py | 3 +++ 2 files changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/709bf6ef/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 f97789b..4d0de7f 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 @@ -198,6 +198,10 @@ def setup_java(): not_if = format("test -f {jdk_curl_target}") ) + File(jdk_curl_target, + mode = 0755, + ) + tmp_java_dir = tempfile.mkdtemp(prefix="jdk_tmp_", dir=params.tmp_dir) try: http://git-wip-us.apache.org/repos/asf/ambari/blob/709bf6ef/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 3b614d9..75c6543 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 @@ -193,6 +193,9 @@ class TestHookBeforeInstall(RMFTestCase): content = DownloadSource('http://c6401.ambari.apache.org:8080/resources//jdk-7u67-linux-x64.tar.gz'), not_if = 'test -f /tmp/jdk-7u67-linux-x64.tar.gz', ) + self.assertResourceCalled('File', '/tmp/jdk-7u67-linux-x64.tar.gz', + mode = 0755, + ) self.assertResourceCalled('Directory', '/usr/jdk64',) self.assertResourceCalled('Execute', ('chmod', 'a+x', u'/usr/jdk64'), sudo = True
