summaryrefslogtreecommitdiff
path: root/ambari-agent
diff options
context:
space:
mode:
authorMahadev Konar <mahadev@apache.org>2012-10-03 23:18:31 +0000
committerMahadev Konar <mahadev@apache.org>2012-10-03 23:18:31 +0000
commitdfb7f03927aee48e81597a1dad0b270067c68563 (patch)
tree77149c2a3336ea5b94204d3e78658fae69ac0599 /ambari-agent
parentff66974b8912a037662212052cbd05b96c11f6e3 (diff)
AMBARI-801. Fix heartbeat message from the agent which is causing NPE at the server. (mahadev)
git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1393810 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'ambari-agent')
-rw-r--r--ambari-agent/src/main/python/ambari_agent/Controller.py3
-rw-r--r--ambari-agent/src/main/python/ambari_agent/Heartbeat.py8
2 files changed, 8 insertions, 3 deletions
diff --git a/ambari-agent/src/main/python/ambari_agent/Controller.py b/ambari-agent/src/main/python/ambari_agent/Controller.py
index 8ad0094f4e..445399cc73 100644
--- a/ambari-agent/src/main/python/ambari_agent/Controller.py
+++ b/ambari-agent/src/main/python/ambari_agent/Controller.py
@@ -107,7 +107,8 @@ class Controller(threading.Thread):
try:
if retry==False:
data = json.dumps(self.heartbeat.build(id))
-
+ pass
+ logger.info("Sending HeartBeat " + pprint.pformat(data))
req = urllib2.Request(self.heartbeatUrl, data, {'Content-Type': 'application/json'})
logger.info(data)
diff --git a/ambari-agent/src/main/python/ambari_agent/Heartbeat.py b/ambari-agent/src/main/python/ambari_agent/Heartbeat.py
index 1699b3f249..e9215f766f 100644
--- a/ambari-agent/src/main/python/ambari_agent/Heartbeat.py
+++ b/ambari-agent/src/main/python/ambari_agent/Heartbeat.py
@@ -39,11 +39,15 @@ class Heartbeat:
timestamp = int(time.time()*1000)
queueResult = self.actionQueue.result()
installedRoleStates = serverStatus.build()
+ nodeStatus = { "status" : "HEALTHY",
+ "cause" : "NONE"}
+
heartbeat = { 'responseId' : int(id),
'timestamp' : timestamp,
'hostname' : socket.gethostname(),
- 'reports' : self.reports,
- 'componentStatus' : self.componentStatus
+ # 'reports' : self.reports,
+ # 'componentStatus' : self.componentStatus,
+ 'nodeStatus' : nodeStatus
}