You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by dm...@apache.org on 2015/05/07 19:11:00 UTC

ambari git commit: AMBARI-10841. If selinux is disabled via /etc/selinux/config, cluster deployment fails (vbrodetsky via dlysnichenko)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.0.maint 0633c7587 -> 7ec541a8c


AMBARI-10841. If selinux is disabled via /etc/selinux/config, cluster deployment fails (vbrodetsky via dlysnichenko)


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

Branch: refs/heads/branch-2.0.maint
Commit: 7ec541a8ce94199ca398dfd30ae187bcd92b4353
Parents: 0633c75
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Thu May 7 20:09:52 2015 +0300
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Thu May 7 20:09:52 2015 +0300

----------------------------------------------------------------------
 .../HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py | 1 +
 .../python/stacks/2.0.6/hooks/before-START/test_before_start.py   | 3 +++
 2 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7ec541a8/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
index b6d2ba2..1814aa8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
@@ -29,6 +29,7 @@ def setup_hadoop():
 
   Execute(("setenforce","0"),
           only_if="test -f /selinux/enforce",
+          not_if="(! which getenforce ) || (which getenforce && getenforce | grep -q Disabled)",
           sudo=True,
   )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/7ec541a8/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
index f606130..b6e0153 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
@@ -34,6 +34,7 @@ class TestHookBeforeStart(RMFTestCase):
     )
     self.assertResourceCalled('Execute', ('setenforce', '0'),
                               only_if = 'test -f /selinux/enforce',
+                              not_if = "(! which getenforce ) || (which getenforce && getenforce | grep -q Disabled)",
                               sudo=True,
                               )
     self.assertResourceCalled('Directory', '/var/log/hadoop',
@@ -95,6 +96,7 @@ class TestHookBeforeStart(RMFTestCase):
     )
     self.assertResourceCalled('Execute', ('setenforce', '0'),
                               only_if = 'test -f /selinux/enforce',
+                              not_if = "(! which getenforce ) || (which getenforce && getenforce | grep -q Disabled)",
                               sudo=True,
                               )
     self.assertResourceCalled('Directory', '/var/log/hadoop',
@@ -161,6 +163,7 @@ class TestHookBeforeStart(RMFTestCase):
     )
     self.assertResourceCalled('Execute', ('setenforce', '0'),
                               only_if = 'test -f /selinux/enforce',
+                              not_if = "(! which getenforce ) || (which getenforce && getenforce | grep -q Disabled)",
                               sudo=True,
                               )
     self.assertResourceCalled('Directory', '/usr/lib/hadoop/lib/native/Linux-i386-32',