You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2014/02/03 17:44:18 UTC

[5/5] git commit: AMBARI-4450. YARN service check fails on centos 5 (Eugene Chekanskiy via aonishuk)

AMBARI-4450. YARN service check fails on centos 5 (Eugene Chekanskiy via
aonishuk)


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

Branch: refs/heads/trunk
Commit: 0de2e012bf8e2d7872d3c9c60bf8eec9b4e4cee7
Parents: 36ebaad
Author: Andrew Onischuk <ao...@hortonworks.com>
Authored: Mon Feb 3 08:42:22 2014 -0800
Committer: Andrew Onischuk <ao...@hortonworks.com>
Committed: Mon Feb 3 08:44:01 2014 -0800

----------------------------------------------------------------------
 .../HDP/2.0.6/services/YARN/package/scripts/service_check.py  | 7 ++++---
 .../test/python/stacks/2.0.6/YARN/test_yarn_service_check.py  | 5 +++--
 2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0de2e012/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/service_check.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/service_check.py
index c53cc78..135b30b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/service_check.py
@@ -21,6 +21,7 @@ Ambari Agent
 """
 
 from resource_management import *
+import sys
 
 class ServiceCheck(Script):
   def service_check(self, env):
@@ -37,8 +38,8 @@ class ServiceCheck(Script):
 
     validateStatusFileName = "validateYarnComponentStatus.py"
     validateStatusFilePath = format("/tmp/{validateStatusFileName}")
-
-    validateStatusCmd = format("{validateStatusFilePath} {component_type} -p {component_address} -s {hadoop_ssl_enabled}")
+    python_executable = sys.executable
+    validateStatusCmd = format("{python_executable} {validateStatusFilePath} {component_type} -p {component_address} -s {hadoop_ssl_enabled}")
 
     if params.security_enabled:
       kinit_cmd = format("{kinit_path_local} -kt {smoke_user_keytab} {smokeuser};")
@@ -60,7 +61,7 @@ class ServiceCheck(Script):
     )
 
     Execute(run_yarn_check_cmd,
-                  user=params.smokeuser
+            user=params.smokeuser
     )
 
 if __name__ == "__main__":

http://git-wip-us.apache.org/repos/asf/ambari/blob/0de2e012/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py
index ce56174..61e8548 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_service_check.py
@@ -20,6 +20,7 @@ limitations under the License.
 from mock.mock import MagicMock, call, patch
 from stacks.utils.RMFTestCase import *
 
+@patch("sys.executable", new = '/usr/bin/python2.6')
 class TestServiceCheck(RMFTestCase):
 
   def test_service_check_default(self):
@@ -33,7 +34,7 @@ class TestServiceCheck(RMFTestCase):
                           content = StaticFile('validateYarnComponentStatus.py'),
                           mode = 493,
     )
-    self.assertResourceCalled('Execute', '/tmp/validateYarnComponentStatus.py rm -p c6402.ambari.apache.org:8088 -s False',
+    self.assertResourceCalled('Execute', '/usr/bin/python2.6 /tmp/validateYarnComponentStatus.py rm -p c6402.ambari.apache.org:8088 -s False',
                           logoutput = True,
                           path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
                           tries = 3,
@@ -55,7 +56,7 @@ class TestServiceCheck(RMFTestCase):
                           content = StaticFile('validateYarnComponentStatus.py'),
                           mode = 493,
     )
-    self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa; /tmp/validateYarnComponentStatus.py rm -p c6402.ambari.apache.org:8088 -s False',
+    self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/smokeuser.headless.keytab ambari-qa; /usr/bin/python2.6 /tmp/validateYarnComponentStatus.py rm -p c6402.ambari.apache.org:8088 -s False',
                           logoutput = True,
                           path = ['/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin'],
                           tries = 3,