cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [4/7] git commit: updated refs/heads/master to c31e8e7
Date Thu, 05 Feb 2015 11:52:45 GMT
agent: don't investigate if host is null, send alert instead

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/master
Commit: 7c41a1184cb4566a6337b8e50978c1e550b601c6
Parents: a2547ed
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Thu Feb 5 16:42:13 2015 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Thu Feb 5 16:42:13 2015 +0530

----------------------------------------------------------------------
 .../cloud/agent/manager/AgentManagerImpl.java   | 24 +++++++++++---------
 1 file changed, 13 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7c41a118/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
index 105a82d..918476c 100644
--- a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java
@@ -438,20 +438,22 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager,
Handl
 
     protected Status investigate(AgentAttache agent) {
         Long hostId = agent.getId();
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("checking if agent (" + hostId + ") is alive");
-        }
-
-        Answer answer = easySend(hostId, new CheckHealthCommand());
-        if (answer != null && answer.getResult()) {
-            Status status = Status.Up;
+        HostVO host = _hostDao.findById(hostId);
+        if (host != null && host.getType() != null && !host.getType().isVirtual())
{
             if (s_logger.isDebugEnabled()) {
-                s_logger.debug("agent (" + hostId + ") responded to checkHeathCommand, reporting
that agent is " + status);
+                s_logger.debug("checking if agent (" + hostId + ") is alive");
             }
-            return status;
+            Answer answer = easySend(hostId, new CheckHealthCommand());
+            if (answer != null && answer.getResult()) {
+                Status status = Status.Up;
+                if (s_logger.isDebugEnabled()) {
+                    s_logger.debug("agent (" + hostId + ") responded to checkHeathCommand,
reporting that agent is " + status);
+                }
+                return status;
+            }
+            return _haMgr.investigate(hostId);
         }
-
-        return _haMgr.investigate(hostId);
+        return Status.Alert;
     }
 
     protected AgentAttache getAttache(final Long hostId) throws AgentUnavailableException
{


Mime
View raw message