Updated Branches: refs/heads/trunk 0bc3050f4 -> 758df470e
AMBARI-2850. ntpd service shows up with error in the agent env. (swagle) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/758df470 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/758df470 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/758df470 Branch: refs/heads/trunk Commit: 758df470ecf9d12b27379d345cdff0678d54ae71 Parents: 0bc3050 Author: Siddharth Wagle <[email protected]> Authored: Thu Aug 8 14:46:37 2013 -0700 Committer: Siddharth Wagle <[email protected]> Committed: Thu Aug 8 14:46:37 2013 -0700 ---------------------------------------------------------------------- ambari-agent/src/main/python/ambari_agent/HostInfo.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/758df470/ambari-agent/src/main/python/ambari_agent/HostInfo.py ---------------------------------------------------------------------- diff --git a/ambari-agent/src/main/python/ambari_agent/HostInfo.py b/ambari-agent/src/main/python/ambari_agent/HostInfo.py index a3fe9ff..5ade94e 100644 --- a/ambari-agent/src/main/python/ambari_agent/HostInfo.py +++ b/ambari-agent/src/main/python/ambari_agent/HostInfo.py @@ -26,7 +26,7 @@ import re import time import subprocess import threading -import AmbariConfig +import shlex from PackagesAnalyzer import PackagesAnalyzer from HostCheckReportFileHandler import HostCheckReportFileHandler from Hardware import Hardware @@ -151,7 +151,9 @@ class HostInfo: svcCheckResult['status'] = "UNKNOWN" svcCheckResult['desc'] = "" try: - osStat = subprocess.Popen(["service", service, "status"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + cmd = "service " + service + " status" + osStat = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, + stderr=subprocess.PIPE) out, err = osStat.communicate() if 0 != osStat.returncode: svcCheckResult['status'] = "Unhealthy"
