From 3260001b657f1b6cd1ea492e595487c1a1feb8bb Mon Sep 17 00:00:00 2001 From: anthony Date: Thu, 21 Oct 2010 10:21:32 -0700 Subject: [PATCH] bug 6665: don't need to send poolEject command for the last host, and mark it as success status 6665: resolved fixed --- server/src/com/cloud/agent/manager/AgentManagerImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/agent/manager/AgentManagerImpl.java b/server/src/com/cloud/agent/manager/AgentManagerImpl.java index be5b866b639..373c220b301 100755 --- a/server/src/com/cloud/agent/manager/AgentManagerImpl.java +++ b/server/src/com/cloud/agent/manager/AgentManagerImpl.java @@ -644,7 +644,7 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory { if (host.getType() == Type.Routing && host.getHypervisorType() == HypervisorType.XenServer ) { if (host.getClusterId() != null) { List hosts = _hostDao.listBy(Type.Routing, host.getClusterId(), host.getPodId(), host.getDataCenterId()); - boolean success = false; + boolean success = true; for( HostVO thost: hosts ) { long thostId = thost.getId(); if( thostId == hostId ) continue; @@ -656,7 +656,8 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory { success = true; break; } else { - s_logger.debug("Eject Host: " + hostId + " from " + thostId + " failed due to " + answer.getDetails()); + success = false; + s_logger.debug("Eject Host: " + hostId + " from " + thostId + " failed due to " + (answer != null ? answer.getDetails() : "no answer")); } } if( !success ){