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());