From 86b51dedcfcabe6992997ee8f7a7779f169625a5 Mon Sep 17 00:00:00 2001 From: Edison Su Date: Thu, 19 Jan 2012 16:44:30 -0800 Subject: [PATCH] bug 12605: if agent is in maintenance mode, don't reconnect to mgt server status 12605: resolved fixed --- agent/src/com/cloud/agent/Agent.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/agent/src/com/cloud/agent/Agent.java b/agent/src/com/cloud/agent/Agent.java index 76fafe48ff6..5a5724ccf0c 100755 --- a/agent/src/com/cloud/agent/Agent.java +++ b/agent/src/com/cloud/agent/Agent.java @@ -43,6 +43,8 @@ import com.cloud.agent.api.AgentControlCommand; import com.cloud.agent.api.Answer; import com.cloud.agent.api.Command; import com.cloud.agent.api.CronCommand; +import com.cloud.agent.api.MaintainAnswer; +import com.cloud.agent.api.MaintainCommand; import com.cloud.agent.api.ModifySshKeysCommand; import com.cloud.agent.api.PingCommand; import com.cloud.agent.api.ReadyCommand; @@ -479,6 +481,11 @@ public class Agent implements HandlerFactory, IAgentControl { cancelTasks(); _reconnectAllowed = false; answer = new Answer(cmd, true, null); + } else if (cmd instanceof MaintainCommand) { + s_logger.debug("Received maintainCommand" ); + cancelTasks(); + _reconnectAllowed = false; + answer = new MaintainAnswer((MaintainCommand)cmd); } else if (cmd instanceof ReadyCommand) { ReadyCommand ready = (ReadyCommand)cmd; s_logger.debug("Received shutdownCommand, due to: " + ready.getDetails());