Updated Branches: refs/heads/4.0 0ec4217aa -> 85455f651
CLOUDSTACK-1137: force reconnect to a disconnected host throws error. Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/85455f65 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/85455f65 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/85455f65 Branch: refs/heads/4.0 Commit: 85455f6514eae17375bc3b6c6d779fc00019653b Parents: 0ec4217 Author: Min Chen <[email protected]> Authored: Thu Feb 14 18:00:33 2013 -0800 Committer: Min Chen <[email protected]> Committed: Thu Feb 14 18:00:33 2013 -0800 ---------------------------------------------------------------------- .../com/cloud/agent/manager/AgentManagerImpl.java | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/85455f65/server/src/com/cloud/agent/manager/AgentManagerImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/agent/manager/AgentManagerImpl.java b/server/src/com/cloud/agent/manager/AgentManagerImpl.java index 62e8acb..6bf629f 100755 --- a/server/src/com/cloud/agent/manager/AgentManagerImpl.java +++ b/server/src/com/cloud/agent/manager/AgentManagerImpl.java @@ -1036,6 +1036,11 @@ public class AgentManagerImpl implements AgentManager, HandlerFactory, Manager { return false; } + if (host.getStatus() == Status.Disconnected) { + s_logger.info("Host is already disconnected, no work to be done"); + return true; + } + if (host.getStatus() != Status.Up && host.getStatus() != Status.Alert && host.getStatus() != Status.Rebalancing) { s_logger.info("Unable to disconnect host because it is not in the correct state: host=" + hostId + "; Status=" + host.getStatus()); return false;
