CLOUDSTACK-1137: force reconnect to a disconnected host throws error.

This commit is contained in:
Min Chen 2013-02-14 18:00:33 -08:00
parent 0ec4217aae
commit 85455f6514
1 changed files with 5 additions and 0 deletions

View File

@ -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;